Alex Stokes
857cc29d27
add content-addressed message id utility
2020-02-28 08:25:03 -08:00
Alex Stokes
ef666267bd
Allow Pubsub
creator to supply a custom msg_id
2020-02-28 08:25:03 -08:00
mhchia
f1dbd52d67
Merge branch 'master' into feature/trio
2020-02-06 10:39:54 +08:00
mhchia
ddbedc6c15
Pubsub: handle_talk
...
- Change from async function to sync
- Change the name to `notify_subscriptions`, which is clearer.
2020-02-05 21:44:33 +08:00
mhchia
7f8c0f11f6
Pubsub: change channel size
...
To `32` to conform to the go implementation.
2020-02-05 21:30:26 +08:00
mhchia
ba0fb8a833
Fix: use pass
over ...
(Ellipse)
...
Use `...`(Ellipse) only in abstract methods.
2020-02-05 20:36:42 +08:00
mhchia
857bb34f4e
Add checkpoints in PubsubNotifee
...
Since some of the methods in `PubsubNotifee` are doing nothing,
add checkpoints to yield control.
2020-02-04 17:45:37 +08:00
mhchia
66975ae3f2
Pubsub: change run_task
to run_daemon_task
2020-02-04 17:43:39 +08:00
mhchia
1588be2be9
Change the channel size of peer queue
...
Back to `0`, to avoid unlimited buffer size.
2020-01-31 17:42:47 +08:00
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
53dbb0aff1
Fix pubsub_notifee.py
...
For wrong syntax and import
2019-12-24 18:37:59 +08:00
mhchia
573c049d0f
Catch expections in PubsubNotifee
...
Also, add lock to avoid resource race condition
2019-12-24 18:31:39 +08:00
mhchia
ce5663705f
Merge branch 'master' into feature/porting-to-trio
2019-12-24 02:19:43 +08:00
Jonathan de Jong
adae81ca01
fix logging bug
2019-12-23 09:15:56 +01:00
Jonathan de Jong
96f6b80e51
Merge remote-tracking branch 'origin/master' into f-string_clean
...
# Conflicts:
# libp2p/network/swarm.py
2019-12-23 09:14:15 +01:00
Jonathan de Jong
0827d0d9ef
add 2 more instances of formatting violations
2019-12-19 18:09:47 +01:00
NIC619
3c75c85d7f
Fix extra white space
2019-12-19 23:07:20 +08:00
NIC Lin
cb80cfc50b
Update libp2p/pubsub/gossipsub.py
...
Co-Authored-By: Chih Cheng Liang <chihchengliang@gmail.com>
2019-12-19 16:33:56 +08:00
NIC619
74092c1371
Apply PR feedback: update error msg
2019-12-19 16:26:37 +08:00
NIC619
e51d376d5e
Combine peers_gossipsub
and peers_floodsub
2019-12-19 14:44:49 +08:00
NIC619
6cd3eb8fae
Apply PR feedback:
...
change param type and remove check before `discard`
2019-12-19 14:15:51 +08:00
NIC619
f3732f9480
Fix tests
2019-12-18 12:37:04 +08:00
NIC619
19ce8a2140
Fix mypy
2019-12-17 21:56:02 +08:00
NIC619
474ed41652
Remove dead peer if floodsub write stream fail
2019-12-17 18:48:25 +08:00
NIC619
009df257bc
Check peer id exist in dict before access
2019-12-17 18:47:58 +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
b4bd997932
Fix mypy
2019-12-17 17:49:49 +08:00
NIC619
65766ec9ac
Change type of local peers var from list to set
2019-12-17 17:36:15 +08:00
NIC619
f1d58ef8ff
Change type of peers from list to set:
...
`peers_gossipsub`, `peers_floodsub` and mesh/fanout peers
2019-12-17 17:30:24 +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
NIC Lin
a675da52ee
Update libp2p/pubsub/gossipsub.py
...
Co-Authored-By: Kevin Mai-Husan Chia <mhchia@users.noreply.github.com>
2019-12-07 15:46:42 +08:00
mhchia
837a249552
Fix security
module
2019-12-07 00:14:01 +08:00
NIC619
2d3bfc8184
Apply PR feedback:
...
use defaultdict and init control message
2019-12-06 23:42:31 +08:00
mhchia
1929f307fb
Fix all modules except for security
2019-12-06 17:06:37 +08:00
NIC619
db0017ddbb
Fix lint after applying suggestion
2019-12-05 17:33:07 +08:00
NIC Lin
b4900d53da
Apply suggestions from code review
...
Co-Authored-By: Chih Cheng Liang <chihchengliang@gmail.com>
2019-12-05 15:21:09 +08:00
NIC619
67f02c512a
Remove unnecessary check and fix test
2019-12-05 15:10:04 +08:00
NIC619
e6813da5f5
Refactor _get_peers_to_send
2019-12-05 14:35:34 +08:00
NIC619
c08b2375e1
Fix: should not remove topic if no peers
2019-12-03 23:10:47 +08:00
NIC619
a9abf1e3dd
Fix list deletion and add list remove check
2019-12-03 22:37:49 +08:00
NIC619
bb15c817b1
Fix var access before assignment
2019-12-03 22:14:45 +08:00
NIC619
ea6cd30a16
Add back some comment and TODO. Add comment to tests
2019-12-03 18:45:33 +08:00