Commit 172cd15e authored by Jeromy's avatar Jeromy

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

License: MIT
Signed-off-by: default avatarJeromy <jeromyj@gmail.com>
parent d21309d1
......@@ -51,7 +51,7 @@ func TestGetFailures(t *testing.T) {
err = merr[0]
}
if err != context.DeadlineExceeded && err != context.Canceled {
if err.Error() != "process closing" {
t.Fatal("Got different error than we expected", err)
}
} else {
......
......@@ -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() {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment