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
which is a feature we don't use much, but Waku Relay supports.
We have to wrap the original handler passed to subscribe so it matches the proc signature that GossipSub expects from a handler.
The flow of subscribe returning a handler which we almost always discard or having to save it to pass as a parameter to unsubscribe is a bit cumbersome.
We should review whether we need/want the feature of subscribing and/or unsubscribing specific handlers, and if so, consider a simpler way.
It could be requiring the user to pass a handler in the format that GossipSub expects and avoid wrapping it ourselves, adding a name/id to each set handler so it can be referenced by the unsubscribe procedure, or any other solution that makes us avoid all the unnecessary discards and spares the user from saving a wrapped handler just in case they want to call unsubscribe.
The text was updated successfully, but these errors were encountered:
Background
Waku Relay's subscribe returns a wrapped handler which we almost always discard
nwaku/waku/waku_relay/protocol.nim
Lines 386 to 388 in 6627e34
the idea of returning the wrapped handler is so we can then unsubscribe to that specific handler
nwaku/waku/waku_relay/protocol.nim
Lines 435 to 440 in 6627e34
which is a feature we don't use much, but Waku Relay supports.
We have to wrap the original handler passed to
subscribe
so it matches the proc signature that GossipSub expects from a handler.The flow of
subscribe
returning a handler which we almost always discard or having to save it to pass as a parameter to unsubscribe is a bit cumbersome.We should review whether we need/want the feature of subscribing and/or unsubscribing specific handlers, and if so, consider a simpler way.
It could be requiring the user to pass a handler in the format that GossipSub expects and avoid wrapping it ourselves, adding a name/id to each set handler so it can be referenced by the unsubscribe procedure, or any other solution that makes us avoid all the unnecessary discards and spares the user from saving a wrapped handler just in case they want to call unsubscribe.
The text was updated successfully, but these errors were encountered: