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 1cf5d8690c
commit ea4a944533
2 changed files with 3 additions and 3 deletions

View File

@ -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 {

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() {