When performing this "promise" pattern, it is important to
provide a
channel with space for one value. Otherwise the sender may
block forever
in the case of a receiver that decides to abandon the
request. A subtle
detail, but one that is important for avoiding
leaked goroutines.
cc @whyrusleeping @jbenet
License: MIT
Signed-off-by: Brian Tiger Chow
<brian@perfmode.com>
License: MIT
Signed-off-by: Brian Tiger Chow <brian@perfmode.com>
This commit makes GetProviders (sync) respect the request context. It
also amends all of GetProviders' callsites to pass a context in. This
meant changing the signature of the dht's handlerfunc.
I think I'll start referring to the request context as Vito Corleone.
cc @whyrusleeping @jbenet
License: MIT
Signed-off-by: Brian Tiger Chow <brian@perfmode.com>