Sans I/O wire protocol for Hypercore
Go to file
Luke Murphy 50f84dfa08
All checks were successful
continuous-integration/drone/push Build is passing
Fix up example, push out a2
2020-08-05 08:16:17 +02:00
simple_message_channels Appease CI setup 2020-08-05 08:08:41 +02:00
test Appease CI setup 2020-08-05 08:08:41 +02:00
.drone.yml Bootstrap SMC 2020-06-30 01:53:34 +02:00
.gitignore Bootstrap SMC 2020-06-30 01:53:34 +02:00
CHANGELOG.md Fix up example, push out a2 2020-08-05 08:16:17 +02:00
LICENSE Bootstrap SMC 2020-06-30 01:53:34 +02:00
poetry.lock Add lock file 2020-07-08 00:19:44 +02:00
pyproject.toml Fix up example, push out a2 2020-08-05 08:16:17 +02:00
README.md Fix up example, push out a2 2020-08-05 08:16:17 +02:00

simple-message-channels

Build Status

Sans I/O wire protocol for Hypercore

Install

$ pip install simple-message-channels

Example

from simple_message_channels import SimpleMessageChannel

smc1 = SimpleMessageChannel()
smc2 = SimpleMessageChannel()

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

for idx in range(0, len(payload)):
    smc2.recv(payload[idx : idx + 1])
print(f"received: {smc2.messages}")

Output:

sent: b'\x04\x01foo'
received: [(0, 1, b'foo')]