simple-message-channels/README.md
Luke Murphy 39107505c2
Some checks failed
continuous-integration/drone/push Build is failing
Add bytes print out
2020-08-04 23:58:23 +02:00

712 B

simple-message-channels

Build Status

Sans I/O wire protocol for Hypercore

Work In Progress

Install

$ pip install simple-message-channels

Example

from simple_message_channels import SimpleMessageChannel

smc_a = SimpleMessageChannel()
smc_b = SimpleMessageChannel()

payload = smc_b.send(0, 1, b"foo")
print(f"sent: {payload})

for idx in range(0, len(payload)):
    smc_a.recv(payload[idx, idx + 1])

for msg in smc_a.messages:
    print(f"received: {msg}")

Output:

sent: ...
received: (0, 1, b"foo")