Fix up example, push out a2
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
Luke Murphy 2020-08-05 08:16:17 +02:00
parent 288996735c
commit 50f84dfa08
No known key found for this signature in database
GPG Key ID: 5E2EF5A63E3718CC
3 changed files with 11 additions and 9 deletions

View File

@ -1,3 +1,7 @@
# simple-message-channel 0.0.1a2 (2020-08-05)
- Fix up documentation example
# simple-message-channel 0.0.1a1 (2020-08-05)
- The first alpha development release is made!

View File

@ -15,22 +15,20 @@ $ pip install simple-message-channels
```python
from simple_message_channels import SimpleMessageChannel
smc_a = SimpleMessageChannel()
smc_b = SimpleMessageChannel()
smc1 = SimpleMessageChannel()
smc2 = SimpleMessageChannel()
payload = smc_b.send(0, 1, b"foo")
payload = smc1.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}")
smc2.recv(payload[idx : idx + 1])
print(f"received: {smc2.messages}")
```
Output:
```sh
sent: b'\x04\x01foo'
received: (0, 1, b'foo')
received: [(0, 1, b'foo')]
```

View File

@ -4,7 +4,7 @@ build-backend = "poetry.masonry.api"
[tool.poetry]
name = "simple-message-channels"
version = "0.0.1a1"
version = "0.0.1a2"
description = "Sans I/O wire protocol for Hypercore"
authors = ["decentral1se <hi@decentral1.se>"]
maintainers = ["decentral1se <hi@decentral1.se>"]