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)
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)
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()
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)
def worker_start(error, worker): if error: Assert.true(False) else: Assert.not_null(worker)
def ack_handler(error=None): Assert.null(error) Test.complete()