def synloop(obj, connection, consumer, blueprint, hub, qos, heartbeat, clock, hbrate=2.0, **kwargs):
 RUN = bootsteps.RUN
 on_task_received = obj.create_task_handler()
 perform_pending_operations = obj.perform_pending_operations
 if getattr(obj.pool, u'is_green', False):
  _enable_amqheartbeats(obj.timer, connection, rate=hbrate)
 consumer.on_message = on_task_received
 consumer.consume()
 obj.on_ready()
 while ((blueprint.state == RUN) and obj.connection):
  state.maybe_shutdown()
  if (qos.prev != qos.value):
   qos.update()
  try:
   perform_pending_operations()
   connection.drain_events(timeout=2.0)
  except socket.timeout:
   pass
  except socket.error:
   if (blueprint.state == RUN):
    raise

def synloop ( obj , connection , consumer , blueprint , hub , qos , heartbeat , clock , hbrate = 2.0 , ** kwargs ) : RUN = bootsteps . RUN on_task_received = obj . create_task_handler ( ) perform_pending_operations = obj . perform_pending_operations if getattr ( obj . pool , u'is_green' , False ) : _enable_amqheartbeats ( obj . timer , connection , rate = hbrate ) consumer . on_message = on_task_received consumer . consume ( ) obj . on_ready ( ) while ( ( blueprint . state == RUN ) and obj . connection ) : state . maybe_shutdown ( ) if ( qos . prev != qos . value ) : qos . update ( ) try : perform_pending_operations ( ) connection . drain_events ( timeout = 2.0 ) except socket . timeout : pass except socket . error : if ( blueprint . state == RUN ) : raise
fallback blocking event loop for transports that doesnt support aio .