Ejemplo n.º 1
0
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)
Ejemplo n.º 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)
Ejemplo n.º 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()
Ejemplo n.º 8
0
 def end_handler():
     Assert.true('foo' in messages)
     Assert.true('bar' in messages)
     Assert.true('baz' in messages)
     Test.complete()
Ejemplo n.º 9
0
def handle_message(message, worker):
  Assert.not_null(message)
  Assert.not_null(message.id)
  Assert.not_null(message.body)
  worker.fail(message)
Ejemplo n.º 10
0
def worker_start(error, worker):
  if error:
    Assert.true(False)
  else:
    Assert.not_null(worker)
Ejemplo n.º 11
0
 def ack_handler(error=None):
   Assert.null(error)
   Test.complete()
Ejemplo n.º 12
0
 def end_handler():
     Assert.true('foo' in messages)
     Assert.true('bar' in messages)
     Assert.true('baz' in messages)
     Test.complete()
Ejemplo n.º 13
0
def message_handler(message):
    Assert.equals("Hello world!", message['body'])
    Test.complete()