in_out.py 350 Bytes
Newer Older
1 2 3 4 5 6 7
#!/usr/bin/env python3

import zmq

import sn


8
def setup():
9 10 11
    return {
            "foo": "bar",
    }
12 13


14
def teardown(context):
15 16 17
    print("teardown")


18
def process(context, msg_type, payload):
19 20 21
    print(msg_type, payload)

    return msg_type, payload
22 23 24


if __name__ == "__main__":
25
    sn.sn_main("in_out", process, setup=setup, teardown=teardown)