Fix pubsub interop: missing unsubscribe_fn

This commit is contained in:
mhchia 2020-02-02 18:17:22 +08:00
parent 1588be2be9
commit 05d5d045ea
No known key found for this signature in database
GPG Key ID: 389EFBEA1362589A

View File

@ -21,7 +21,7 @@ async def p2pd_subscribe(p2pd, topic, nursery):
stream = TrioTCPStream(await p2pd.control.pubsub_subscribe(topic))
send_channel, receive_channel = trio.open_memory_channel(math.inf)
sub = TrioSubscriptionAPI(receive_channel)
sub = TrioSubscriptionAPI(receive_channel, unsubscribe_fn=stream.close)
async def _read_pubsub_msg() -> None:
while True: