mhchia
095a848f30
Add clean-up logics into TrioSubscriptionAPI
...
Register an `unsubscribe_fn` when initializing the TrioSubscriptionAPI.
`unsubscribe_fn` is called when subscription is unsubscribed.
2020-01-28 00:29:05 +08:00
mhchia
c3ba67ea87
Remove locks in PubsubNotifee
...
- Change `open_memory_channel(0)` to `open_memory_channel(math.inf)`, to
avoid `peer_queue.send` and `dead_peer_queue.send` blocking. This allows
us to remove the locks.
- Only catch `trio.BrokenResourceError`, which is caused by Pubsub when
it's closing.
2020-01-27 14:30:44 +08:00
mhchia
92ea35e147
Fix IPubsub
and add IPubsub.wait_until_ready
2020-01-27 00:10:33 +08:00
mhchia
e3a1dd62e4
Use new type hinting for trio channel
2020-01-26 23:56:19 +08:00
mhchia
6c7aa30191
Add events in Pubsub
...
To ensure `handle_peer_queue` and `handle_dead_peer_queue` are indeed
run before the tests finish. Previously, we get errors when performing
`iter_dag` after cancellation. This is because `handle_peer_queue` or
`handle_dead_peer_queue` is not actually run before the Service is
cancelled.
2020-01-18 00:17:30 +08:00
mhchia
94f0fcb6ad
Iterate dead_peer_receive_channel
with async for
2019-12-26 20:44:32 +08:00
mhchia
ce5663705f
Merge branch 'master' into feature/porting-to-trio
2019-12-24 02:19:43 +08:00
NIC619
19ce8a2140
Fix mypy
2019-12-17 21:56:02 +08:00
mhchia
47d10e186f
Add SubscriptionAPI
...
And `TrioSubscriptionAPI`, to make subscription io-agnostic.
2019-12-17 18:17:28 +08:00
NIC619
f10e3099cb
Change type of peers in pubsub from list to set
2019-12-17 17:55:13 +08:00
NIC619
7d6daa8e10
Minor cleanup:
...
- remove outdated comment
- add new peer at the end
- turn peers to send from list to set
2019-12-17 17:17:03 +08:00
mhchia
fb0519129d
Refine Mplex.close
and SwarmConn.close
...
Ensure `close` cleans up things and cancel the service finally.
2019-12-17 15:50:55 +08:00
Alex Stokes
733b1d08b6
Merge pull request #372 from ralexstokes/add-py36-compatibility
...
Add py36 compatibility
2019-12-10 17:28:49 -08:00
mhchia
1929f307fb
Fix all modules except for security
2019-12-06 17:06:37 +08:00
NIC619
c08b2375e1
Fix: should not remove topic if no peers
2019-12-03 23:10:47 +08:00
mhchia
e9ab0646e3
Fix Pubsub
2019-12-03 17:27:49 +08:00
Alex Stokes
63fd531ed0
Fixes to add python 3.6 compatibility
2019-12-02 16:33:32 -08:00
NIC619
920cf646ef
Fix lint and add check in fanout heartbeat
2019-12-02 22:49:27 +08:00
NIC619
0a52a05375
Del entry if no more peers subscribe to the topic
2019-11-30 20:02:11 +08:00
NIC619
e59ac6a250
Cleanup TODOs in pubsub
2019-11-30 17:12:37 +08:00
NIC619
658a0ae156
Apply PR feedback:
...
move signature validation logic into signature validator
2019-11-29 19:37:48 +08:00
NIC619
1c54c38ca7
Fix lint and add signing_strict
to interop tests
2019-11-29 17:24:40 +08:00
NIC619
a262b94836
Apply PR feedback:
...
check if signing key and ID match
2019-11-29 14:12:42 +08:00
NIC619
064c109b64
Fix signature validator:
...
Add prefix and return verify result
2019-11-28 18:45:00 +08:00
NIC619
d5d6962dce
Update Pubsub fixture and test
2019-11-27 17:15:24 +08:00
NIC619
0fd400fdf8
Sign and verify in Pubsub
2019-11-27 17:15:24 +08:00
NIC619
683710573e
Add strict_signing: bool and sign_key
to Pubsub
2019-11-27 17:15:23 +08:00
NIC619
e355cb2600
Apply PR feedback:
...
Only use pop method if error handling is in place
2019-11-23 16:04:22 +08:00
NIC619
501eef59de
Apply PR feedback:
...
Only use pop method if graceful failure handling is desired
2019-11-21 14:48:03 +08:00
NIC619
19907e18ec
Replace (check and) del pattern with pop method
2019-11-20 23:06:37 +08:00
NIC619
ace5ef69a8
Apply PR feedback:
...
handle pubsub dead peer when stream closed in gossipsub
2019-11-16 17:03:04 +08:00
NIC619
9be9b4bbfc
Handle StreamClosed
in pub/gossip/flood-sub
2019-11-16 16:56:59 +08:00
NIC619
b8c7f0cfff
Fix lint
2019-11-09 23:55:35 +08:00
NIC619
5dfa29a0df
Track tasks created in pubsub and add close()
2019-11-09 23:24:09 +08:00
NIC619
93ef36bd86
Clean up peer record if pubsub stream fail
2019-11-09 23:24:09 +08:00
NIC619
eeb87848af
Apply PR feedback:
...
- fix await stream close/reset
- make `_handle_dead_peer` a sync function
2019-11-09 23:24:09 +08:00
NIC619
d36e323703
Update error handling of pubsub stream handler
2019-11-09 23:24:08 +08:00
NIC619
a8d9536b08
Spin up handle_dead_peer_queue
task
2019-11-09 23:24:08 +08:00
NIC619
84f5210220
Implement handle_dead_peer_queue
2019-11-09 23:24:08 +08:00
NIC619
c6c9393f2b
Add dead_peer_queue
to pubsub
2019-11-09 23:24:08 +08:00
Dominik Muhs
bafdd8512d
Enforce pre-summary newline in docstrings
2019-10-24 20:10:45 +02:00
Dominik Muhs
eef505f2d9
Add automatic docstring formatter and apply
2019-10-24 08:41:10 +02:00
Moshe Malawach
986a852e7e
Remove forced debug level
2019-10-01 11:17:05 +02:00
Kevin Mai-Husan Chia
dbc35e8b9d
Merge pull request #310 from mhchia/fix/missing_await_for_stream_reset_in_pubsub
...
Add the missing `await` for `stream.reset` in pubsub
2019-09-24 14:04:25 +08:00
mhchia
da34b086d5
Merge branch 'master' into fix/change-notifee-and-add-tests-for-swarm-conn-and-mplex
2019-09-24 13:50:54 +08:00
mhchia
b0c919aab7
Add the missing await
2019-09-24 13:34:26 +08:00
mhchia
d1c25b8b1e
Fix interop pubsub tests and PR feedback
...
- Use `from_id`, the changed field name in `PSMessage`.
- PR feedbacks
- Add label `test` in `testenv` in tox.ini, to avoid wrong
dispatching an environment's command in the future.
- Use `pytest` over `py.test`.
2019-09-24 11:30:52 +08:00
mhchia
6f8394e4bd
Merge branch 'master' into fix/change-notifee-and-add-tests-for-swarm-conn-and-mplex
2019-09-21 18:34:12 +08:00
mhchia
b8b5ac5e06
Add test for notifee disconnected
2019-09-19 16:31:41 +08:00
mhchia
5307c0506b
Change IMuxedConn
to INetConn
in Notifee
2019-09-19 16:31:41 +08:00