Commit de59d5c1 authored by Jeromy's avatar Jeromy

add more bitswap task workers

parent 6bae251a
......@@ -9,16 +9,20 @@ import (
u "github.com/ipfs/go-ipfs/util"
)
var TaskWorkerCount = 4
func (bs *Bitswap) startWorkers(px process.Process, ctx context.Context) {
// Start up a worker to handle block requests this node is making
px.Go(func(px process.Process) {
bs.clientWorker(ctx)
})
// Start up a worker to handle requests from other nodes for the data on this node
px.Go(func(px process.Process) {
bs.taskWorker(ctx)
})
// Start up workers to handle requests from other nodes for the data on this node
for i := 0; i < TaskWorkerCount; i++ {
px.Go(func(px process.Process) {
bs.taskWorker(ctx)
})
}
// Start up a worker to manage periodically resending our wantlist out to peers
px.Go(func(px process.Process) {
......
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