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
Trying to send N jobs and wait until all of them are completed, is correct to assume that JobHandler will be always called, even when an error occurs?
Currently I'm using a sync.WaitGroup, so in the case that not all of the response handlers are invoked the client could hang forever, and would like to make sure this should never happen.
Thanks in advance, and congrats for the job! :)
The text was updated successfully, but these errors were encountered:
How about using a channel and a goroutine to collect results? JobHandler receives the data and sends to the chan, then you can put a timeout into the select goroutine.
Trying to send
N
jobs and wait until all of them are completed, is correct to assume thatJobHandler
will be always called, even when an error occurs?Currently I'm using a
sync.WaitGroup
, so in the case that not all of the response handlers are invoked the client could hang forever, and would like to make sure this should never happen.Thanks in advance, and congrats for the job! :)
The text was updated successfully, but these errors were encountered: