Skip to content

Commit

Permalink
Merge pull request #34 from baerwang/optimization
Browse files Browse the repository at this point in the history
style:change bool to struct{}
  • Loading branch information
AlexStocks authored Jun 29, 2022
2 parents 56f17f4 + 62546a2 commit 846a3b3
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions pkg/protocol/message/other_message.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,13 @@ type MessageFuture struct {
ID int32
Err error
Response interface{}
Done chan bool
Done chan struct{}
}

func NewMessageFuture(message RpcMessage) *MessageFuture {
return &MessageFuture{
ID: message.ID,
Done: make(chan bool),
Done: make(chan struct{}),
}
}

Expand Down
2 changes: 1 addition & 1 deletion pkg/remoting/getty/getty_remoting.go
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ func (client *GettyRemoting) NotifyRpcMessageResponse(rpcMessage message.RpcMess
messageFuture.Response = rpcMessage.Body
// todo add messageFuture.Err
//messageFuture.Err = rpcMessage.Err
messageFuture.Done <- true
messageFuture.Done <- struct{}{}
//client.msgFutures.Delete(rpcMessage.RequestID)
} else {
log.Infof("msg: {} is not found in msgFutures.", rpcMessage.ID)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ func (f *clientOnResponseProcessor) Process(ctx context.Context, rpcMessage mess
response := getty2.GetGettyRemotingInstance().GetMessageFuture(msgID)
if response != nil {
response.Response = mergedResult.Msgs[i]
response.Done <- true
response.Done <- struct{}{}
getty2.GetGettyRemotingInstance().RemoveMessageFuture(msgID)
}
}
Expand Down

0 comments on commit 846a3b3

Please sign in to comment.