Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
dms3
go-bitswap
Commits
a3353790
Commit
a3353790
authored
Sep 08, 2015
by
Jeromy
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
use new methods from goprocess/context, remove thirdparty/waitable
License: MIT Signed-off-by:
Jeromy
<
jeromyj@gmail.com
>
parent
3fb16528
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
3 deletions
+3
-3
workers.go
workers.go
+3
-3
No files found.
workers.go
View file @
a3353790
...
...
@@ -4,9 +4,9 @@ import (
"time"
process
"github.com/ipfs/go-ipfs/Godeps/_workspace/src/github.com/jbenet/goprocess"
procctx
"github.com/ipfs/go-ipfs/Godeps/_workspace/src/github.com/jbenet/goprocess/context"
ratelimit
"github.com/ipfs/go-ipfs/Godeps/_workspace/src/github.com/jbenet/goprocess/ratelimit"
context
"github.com/ipfs/go-ipfs/Godeps/_workspace/src/golang.org/x/net/context"
waitable
"github.com/ipfs/go-ipfs/thirdparty/waitable"
key
"github.com/ipfs/go-ipfs/blocks/key"
eventlog
"github.com/ipfs/go-ipfs/thirdparty/eventlog"
...
...
@@ -80,7 +80,7 @@ func (bs *Bitswap) provideWorker(px process.Process) {
ev
:=
eventlog
.
LoggableMap
{
"ID"
:
wid
}
limiter
.
LimitedGo
(
func
(
px
process
.
Process
)
{
ctx
:=
waitable
.
Context
(
px
)
// derive ctx from px
ctx
:=
procctx
.
OnClosing
Context
(
px
)
// derive ctx from px
defer
log
.
EventBegin
(
ctx
,
"Bitswap.ProvideWorker.Work"
,
ev
,
&
k
)
.
Done
()
ctx
,
cancel
:=
context
.
WithTimeout
(
ctx
,
provideTimeout
)
// timeout ctx
...
...
@@ -97,7 +97,7 @@ func (bs *Bitswap) provideWorker(px process.Process) {
limiter
.
Go
(
func
(
px
process
.
Process
)
{
for
wid
:=
2
;
;
wid
++
{
ev
:=
eventlog
.
LoggableMap
{
"ID"
:
1
}
log
.
Event
(
waitable
.
Context
(
px
),
"Bitswap.ProvideWorker.Loop"
,
ev
)
log
.
Event
(
procctx
.
OnClosing
Context
(
px
),
"Bitswap.ProvideWorker.Loop"
,
ev
)
select
{
case
<-
px
.
Closing
()
:
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment