Deciders and activity workers interact with SWF using long polling. They regularly send messages to SWF indicating that they are ready to receive a task from a predefined task list. In case there is a task already available to assign, SWF responds with the task immediately. If the task is not available, SWF keeps the TCP connection alive for up to 60 seconds. If a task becomes available in these 60 seconds, it responds back with the task. If there is no task available within these 60 seconds, SWF responds back with an empty response and the connection is closed. In cases where the decider or activity worker receives an empty response, they should poll for the task again.
Long polling is suitable when there is a high volume of tasks available for processing. It is recommended you keep deciders and activity workers behind a firewall.