提交 3178dfe7 作者: Jeromy

add more bitswap task workers

上级 a97e9e70
...@@ -9,16 +9,20 @@ import ( ...@@ -9,16 +9,20 @@ import (
u "github.com/ipfs/go-ipfs/util" u "github.com/ipfs/go-ipfs/util"
) )
var TaskWorkerCount = 4
func (bs *Bitswap) startWorkers(px process.Process, ctx context.Context) { func (bs *Bitswap) startWorkers(px process.Process, ctx context.Context) {
// Start up a worker to handle block requests this node is making // Start up a worker to handle block requests this node is making
px.Go(func(px process.Process) { px.Go(func(px process.Process) {
bs.clientWorker(ctx) bs.clientWorker(ctx)
}) })
// Start up a worker to handle requests from other nodes for the data on this node // Start up workers to handle requests from other nodes for the data on this node
px.Go(func(px process.Process) { for i := 0; i < TaskWorkerCount; i++ {
bs.taskWorker(ctx) px.Go(func(px process.Process) {
}) bs.taskWorker(ctx)
})
}
// Start up a worker to manage periodically resending our wantlist out to peers // Start up a worker to manage periodically resending our wantlist out to peers
px.Go(func(px process.Process) { px.Go(func(px process.Process) {
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论