Commit 9124c5ca authored by suyanlong's avatar suyanlong

Add Port const Capacity value

parent ed23830e
Pipeline #8011 canceled with stages
...@@ -42,7 +42,7 @@ func NewPort(client plugins.Client, cryptor txcrypto.Cryptor, logger logrus.Fiel ...@@ -42,7 +42,7 @@ func NewPort(client plugins.Client, cryptor txcrypto.Cryptor, logger logrus.Fiel
recvCh: make(chan *pb.IBTP, 1024), recvCh: make(chan *pb.IBTP, 1024),
ctx: ctx, ctx: ctx,
cancel: cancel, cancel: cancel,
msgCh: make(chan *pb.Message, 10), msgCh: make(chan *pb.Message, port.Capacity),
}, nil }, nil
} }
......
...@@ -26,7 +26,7 @@ func newLocal(id peer.ID) *local { ...@@ -26,7 +26,7 @@ func newLocal(id peer.ID) *local {
return &local{ return &local{
id: id, id: id,
tag: Office, tag: Office,
rev: make(chan *pb.Message, 10), rev: make(chan *pb.Message, port.MaxCapacity),
} }
} }
......
...@@ -13,7 +13,7 @@ type sidecar struct { ...@@ -13,7 +13,7 @@ type sidecar struct {
} }
func newSidecar(id string, tag string, swarm *Swarm) *sidecar { func newSidecar(id string, tag string, swarm *Swarm) *sidecar {
rec := make(chan *pb.Message, 10) rec := make(chan *pb.Message, port.Capacity)
return &sidecar{ return &sidecar{
id: id, id: id,
swarm: swarm, swarm: swarm,
......
...@@ -9,3 +9,9 @@ const ( ...@@ -9,3 +9,9 @@ const (
Appchain = "appchain" // 区块链客户端 Appchain = "appchain" // 区块链客户端
Local = "local" Local = "local"
) )
const (
MinCapacity = 1
Capacity = 10
MaxCapacity = 1024
)
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