wingfoil-python 3.3.0

python bindings for wingfoil - graph based stream processing framework
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#!/usr/bin/env python3
"""ZMQ publisher example: publishes a counter as bytes every 500ms."""

import struct
import wingfoil as wf

PORT = 5555
print(f"Publishing on tcp://127.0.0.1:{PORT} ...")

(
    wf.ticker(0.5)
    .count()
    .inspect(lambda n: print(f"publishing: {n}"))
    .map(lambda n: struct.pack(">Q", n))  # u64 big-endian bytes
    .zmq_pub(PORT)
    .run(realtime=True)
)