oxen-pyoxenmq/examples/test.py

16 lines
284 B
Python
Raw Normal View History

import pyoxenmq
2020-07-20 14:19:09 +02:00
import time
def handle_ping(args):
print(args)
return args
lmq = pyoxenmq.OxenMQ()
2020-07-20 14:19:09 +02:00
lmq.listen_plain("ipc:///tmp/lmq.sock")
lmq.add_anonymous_category("python")
lmq.add_request_command("python", "ping", handle_ping)
lmq.start()
while True:
time.sleep(1)