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
I am not convinced by your explanation. Either the process is synchronous (I send a findNodes request and I wait for some kind of side effect, like a response that may or may not be related to the message I broadcasted) and therefore the process should block until some condition is met (whatever the condition). In case the process is instead asynchronous, sendFindNodes should follow a fire-and-forget model (and therefore there should be no followup in the same thread/goroutine basically). In both cases, the sleep is inappropriate.
I think that what you want might be an heuristic condition, best modeled with a sync.WaitGroup
Derived from this discussion of #141:
I am not convinced by your explanation. Either the process is synchronous (I send a
findNodes
request and I wait for some kind of side effect, like a response that may or may not be related to the message I broadcasted) and therefore the process should block until some condition is met (whatever the condition). In case the process is instead asynchronous,sendFindNodes
should follow a fire-and-forget model (and therefore there should be no followup in the same thread/goroutine basically). In both cases, thesleep
is inappropriate.I think that what you want might be an heuristic condition, best modeled with a
sync.WaitGroup
Originally posted by @autholykos in #141
We decided that using sync.WaitGroup might be a better solution for the steps done in
protocol.go
-> Bootstrapping and Network_Discovery.The text was updated successfully, but these errors were encountered: