def test_multipublish(): with NsqdIntegrationServer() as server: producer = Producer(server.tcp_address) producer.start() for _ in range(10): producer.multipublish('test', 10 * [b'hi']) producer.close() producer.join() conn = NsqdHTTPClient(server.address, server.http_port) stats = conn.stats() assert stats['topics'][0]['depth'] == 100
def test_async_multipublish(): with NsqdIntegrationServer() as server: results = [] producer = Producer(server.tcp_address) producer.start() for _ in range(10): result = producer.multipublish( 'test', 10 * [b'hi'], raise_error=False) results.append(result) gevent.joinall(results, raise_error=True) producer.close() producer.join() conn = NsqdHTTPClient(server.address, server.http_port) stats = conn.stats() assert stats['topics'][0]['depth'] == 100