def try_deferred_long_poll(routing_keys, event_uuids, &handler)
      # Proc for running long-poll in EM defer thread since this is a blocking call
      @defer_operation_proc = Proc.new { try_long_poll(routing_keys, event_uuids, &handler) }

      # Proc that runs in main EM reactor thread to handle result from above operation proc
      @defer_callback_proc = Proc.new { |result| @event_uuids = process_long_poll(result) }

      # Use EM defer thread since the long-poll will block
      EM.defer(@defer_operation_proc, @defer_callback_proc)
      true
    end
def try_deferred_long_poll(routing_keys, event_uuids, &handler)
      # Proc for running long-poll in EM defer thread since this is a blocking call
      @defer_operation_proc = Proc.new { try_long_poll(routing_keys, event_uuids, &handler) }

      # Proc that runs in main EM reactor thread to handle result from above operation proc
      @defer_callback_proc = Proc.new { |result| @event_uuids = process_long_poll(result) }

      # Use EM defer thread since the long-poll will block
      EM.defer(@defer_operation_proc, @defer_callback_proc)
      true
    end
Try to make long-polling request to receive events using EM defer thread
 Repeat long-polling until there is an error or the stop time has been reached

 @param [Array, NilClass] routing_keys for event sources of interest with nil meaning all
 @param [Array, NilClass] event_uuids from previous poll

 @yield [event] required block called each time event received
 @yieldparam [Hash] event received

 @return [Array, NilClass] UUIDs of events received, or nil if none