kopia lustrzana https://github.com/Yakifo/amqtt
20 wiersze
491 B
Python
20 wiersze
491 B
Python
import logging
|
|
import asyncio
|
|
from hbmqtt.broker import Broker
|
|
|
|
logger = logging.getLogger(__name__)
|
|
|
|
broker = Broker()
|
|
|
|
@asyncio.coroutine
|
|
def test_coro():
|
|
yield from broker.start()
|
|
yield from asyncio.sleep(5)
|
|
yield from broker.shutdown()
|
|
|
|
|
|
if __name__ == '__main__':
|
|
formatter = "[%(asctime)s] {%(filename)s:%(lineno)d} %(levelname)s - %(message)s"
|
|
logging.basicConfig(level=logging.DEBUG, format=formatter)
|
|
asyncio.get_event_loop().run_until_complete(test_coro())
|