waku-org / go-waku

Go implementation of Waku v2 protocol
https://waku.org/
Other
120 stars 43 forks source link

feat: have a timeout for on-demand peer discovery when any of the protocol API's are used #997

Closed chaitanyaprem closed 9 months ago

chaitanyaprem commented 10 months ago

Background

As of now on-demand peer discovery happens when no peer is available for a particular protocol and pubsubTopic specified in a protocol API such as publish/light publish/filter subscribe. This discovery doesn't have an internal timeout and rather depends on the caller context and runs discovery until then.

Details

As explained here it is not great dev-ex, especially if no error is returned in such case. It would be good to have a configurable timeout for discovery and return appropriate error in case peers could not be discovered for specified criteria.

chaitanyaprem commented 9 months ago

Since there is a work-around for user passing the context which has a timeout, descoping it from go-waku.

If there is a need for this at a later stage, it can be addressed.