def start_handler(error, feeder):
  if error:
    Assert.true(False)
  else:
    def ack_handler(error=None):
      Assert.not_null(error)
      Test.complete()
    feeder.feed({'body': 'Hello world!'}, tag='test', handler=ack_handler)
예제 #2
0
def start_handler(error, feeder):
  if error:
    Assert.true(False)
  else:
    def ack_handler(error=None):
      Assert.null(error)
      Test.complete()

    def do_feed(timer_id):
      feeder.feed({'body': 'Hello world!'}, tag='test', handler=ack_handler)
    vertx.set_timer(1000, do_feed)
def start_handler(error, feeder):
    if error:
        Assert.true(False)

    @feeder.feed_handler
    def feed_handler(message):
        def ack_handler(error):
            Assert.null(error)
            Test.complete()

        feeder.feed({"body": "Hello world!"}, tag="test", handler=ack_handler)
예제 #4
0
def handle_message(message, worker):
  Assert.not_null(message)
  Assert.not_null(message.id)
  Assert.not_null(message.body)
  Assert.equals('test', message.tag)
  worker.emit(message.body, parent=message)
  worker.ack(message)
def start_handler(error, feeder):
  if error:
    Assert.true(False)

  @feeder.full_handler
  def full_handler():
    pass

  @feeder.drain_handler
  def drain_handler():
    pass

  def ack_handler(error):
    Assert.null(error)
    Test.complete()

  while not feeder.queue_full():
    feeder.feed({'body': 'Hello world!'}, tag='test', handler=ack_handler)
 def ack_handler(error):
   Assert.not_null(error)
   Test.complete()
def message_handler(message):
    Assert.equals("Hello world!", message['body'])
    Test.complete()
예제 #8
0
 def end_handler():
     Assert.true('foo' in messages)
     Assert.true('bar' in messages)
     Assert.true('baz' in messages)
     Test.complete()
def handle_message(message, worker):
  Assert.not_null(message)
  Assert.not_null(message.id)
  Assert.not_null(message.body)
  worker.fail(message)
예제 #10
0
def worker_start(error, worker):
  if error:
    Assert.true(False)
  else:
    Assert.not_null(worker)
예제 #11
0
 def ack_handler(error=None):
   Assert.null(error)
   Test.complete()
예제 #12
0
 def end_handler():
     Assert.true('foo' in messages)
     Assert.true('bar' in messages)
     Assert.true('baz' in messages)
     Test.complete()
예제 #13
0
def message_handler(message):
    Assert.equals("Hello world!", message['body'])
    Test.complete()