Sans I/O wire protocol for Hypercore
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Luke Murphy 50f84dfa08
Fix up example, push out a2
1 month ago
simple_message_channels Appease CI setup 1 month ago
test Appease CI setup 1 month ago
.drone.yml Bootstrap SMC 2 months ago
.gitignore Bootstrap SMC 2 months ago
CHANGELOG.md Fix up example, push out a2 1 month ago
LICENSE Bootstrap SMC 2 months ago
README.md Fix up example, push out a2 1 month ago
poetry.lock Add lock file 2 months ago
pyproject.toml Fix up example, push out a2 1 month ago

README.md

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')]