1
0
mirror of https://github.com/ipfs/kubo.git synced 2025-09-09 17:22:21 +08:00

use new methods from goprocess/context, remove thirdparty/waitable

License: MIT
Signed-off-by: Jeromy <jeromyj@gmail.com>
This commit is contained in:
Jeromy
2015-09-08 21:15:53 -07:00
parent d5cfb01f64
commit c3280ce885
10 changed files with 79 additions and 30 deletions

View File

@ -85,7 +85,7 @@ type dhtQueryRunner struct {
func newQueryRunner(q *dhtQuery) *dhtQueryRunner {
proc := process.WithParent(process.Background())
ctx := ctxproc.WithProcessClosing(context.Background(), proc)
ctx := ctxproc.OnClosingContext(proc)
return &dhtQueryRunner{
query: q,
peersToQuery: queue.NewChanQueue(ctx, queue.NewXORDistancePQ(q.key)),
@ -210,7 +210,7 @@ func (r *dhtQueryRunner) queryPeer(proc process.Process, p peer.ID) {
// ok let's do this!
// create a context from our proc.
ctx := ctxproc.WithProcessClosing(context.Background(), proc)
ctx := ctxproc.OnClosingContext(proc)
// make sure we do this when we exit
defer func() {