Skip to content

Commit

Permalink
Fix bug of the node module
Browse files Browse the repository at this point in the history
  • Loading branch information
dobyte committed Feb 19, 2025
1 parent d91e2e0 commit fc198d6
Showing 1 changed file with 13 additions and 9 deletions.
22 changes: 13 additions & 9 deletions cluster/node/node.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,17 +66,21 @@ func NewNode(opts ...Option) *Node {
n.state.Store(int32(cluster.Shut))
n.wg = &sync.WaitGroup{}
n.evtPool = &sync.Pool{New: func() interface{} {
return &event{
ctx: context.Background(),
node: n,
}
evt := &event{}
evt.ctx = context.Background()
evt.node = n
evt.actor.Store((*Actor)(nil))

return evt
}}
n.reqPool = &sync.Pool{New: func() interface{} {
return &request{
ctx: context.Background(),
node: n,
message: &cluster.Message{},
}
req := &request{}
req.ctx = context.Background()
req.node = n
req.message = &cluster.Message{}
req.actor.Store((*Actor)(nil))

return req
}}

return n
Expand Down

0 comments on commit fc198d6

Please sign in to comment.