Skip to content

Sentinel-13: rpc comment thru #13

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Dec 21, 2023
Merged

Sentinel-13: rpc comment thru #13

merged 1 commit into from
Dec 21, 2023

Conversation

ReshiAdavan
Copy link
Owner

None

@ReshiAdavan ReshiAdavan added the Review PR is in review label Dec 21, 2023
@@ -46,22 +46,25 @@ import (
"github.com/ReshiAdavan/Sentinel/gobWrapper"
)

// reqMsg represents a request message in the RPC system.
type reqMsg struct {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider using a more descriptive name for endname. It's not immediately clear what endname refers to.

args []byte
replyCh chan replyMsg
endname interface{} // Name of sending ClientEnd
svcMeth string // e.g., "Raft.AppendEntries"

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The comment for svcMeth could be more descriptive. Consider explaining what svcMeth is used for in the context of the RPC system.

replyCh chan replyMsg
endname interface{} // Name of sending ClientEnd
svcMeth string // e.g., "Raft.AppendEntries"
argsType reflect.Type // Reflect type of the arguments

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The comment for argsType could be more descriptive. Consider explaining why the type of the arguments is important in the context of the RPC system.

endname interface{} // Name of sending ClientEnd
svcMeth string // e.g., "Raft.AppendEntries"
argsType reflect.Type // Reflect type of the arguments
args []byte // Arguments of the RPC, encoded as bytes

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The comment for args could be more descriptive. Consider explaining why the arguments need to be encoded as bytes.

svcMeth string // e.g., "Raft.AppendEntries"
argsType reflect.Type // Reflect type of the arguments
args []byte // Arguments of the RPC, encoded as bytes
replyCh chan replyMsg // Channel for receiving the reply

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The comment for replyCh could be more descriptive. Consider explaining why a channel is used for receiving the reply.

type replyMsg struct {
ok bool
reply []byte
ok bool // True if the server executed the request

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The comment for ok could be more descriptive. Consider explaining what happens if the server does not execute the request.

ok bool
reply []byte
ok bool // True if the server executed the request
reply []byte // Reply of the RPC, encoded as bytes

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The comment for reply could be more descriptive. Consider explaining why the reply needs to be encoded as bytes.

type ClientEnd struct {
endname interface{} // this end-point's name
ch chan reqMsg // copy of Network.endCh
endname interface{} // This end-point's name

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider using a more descriptive name for endname. It's not immediately clear what endname refers to.

endname interface{} // this end-point's name
ch chan reqMsg // copy of Network.endCh
endname interface{} // This end-point's name
ch chan reqMsg // Channel to send requests

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The comment for ch could be more descriptive. Consider explaining why a channel is used to send requests.

@@ -96,6 +99,7 @@ func (e *ClientEnd) Call(svcMeth string, args interface{}, reply interface{}) bo
}
}

// Network simulates a network for RPC communication.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The comment // Network simulates a network for RPC communication. is not very descriptive. Consider providing more details about the purpose and functionality of the Network struct.

@ReshiAdavan ReshiAdavan merged commit e998d8b into master Dec 21, 2023
@ReshiAdavan ReshiAdavan deleted the Sentinel-13 branch December 21, 2023 19:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Review PR is in review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant