You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// Close closes down the topic. Will return an error unless there are no active event handlers or subscriptions.
IIUC the reasoning is that since only one valid Topic handle can exist for a given topic that when that handler calls Close() it is willing to kill any existing Subscription or TopicEventHandler objects that are outstanding.
This may clean up some code, by removing a bunch of error checking/handling, but comes at the cost of adding complexity for a Topic with N Subscriptions that only wants to close when all N Subscriptions are closed.
@Stebalien mentioned in libp2p/go-libp2p-pubsub-router#37 (comment) that the restrictions posed on closing a Topic handle shouldn't need to exist
go-libp2p-pubsub/topic.go
Line 187 in 01b9825
IIUC the reasoning is that since only one valid
Topic
handle can exist for a given topic that when that handler callsClose()
it is willing to kill any existingSubscription
orTopicEventHandler
objects that are outstanding.This may clean up some code, by removing a bunch of error checking/handling, but comes at the cost of adding complexity for a
Topic
with NSubscription
s that only wants to close when all NSubscription
s are closed.Both options are by me. WDYT @vyzo?
The text was updated successfully, but these errors were encountered: