mirror of
https://github.com/tendermint/tendermint.git
synced 2026-07-29 19:42:51 +00:00
write docs for Reactor interface
This commit is contained in:
+13
-1
@@ -8,11 +8,23 @@ import (
|
||||
type Reactor interface {
|
||||
cmn.Service // Start, Stop
|
||||
|
||||
// SetSwitch allows setting a switch.
|
||||
SetSwitch(*Switch)
|
||||
|
||||
// GetChannels returns the list of channel descriptors.
|
||||
GetChannels() []*conn.ChannelDescriptor
|
||||
|
||||
// AddPeer is called by the switch when a new peer is added.
|
||||
AddPeer(peer Peer)
|
||||
|
||||
// RemovePeer is called by the switch when the peer is stopped (due to error
|
||||
// or other reason).
|
||||
RemovePeer(peer Peer, reason interface{})
|
||||
Receive(chID byte, peer Peer, msgBytes []byte) // CONTRACT: msgBytes are not nil
|
||||
|
||||
// Receive is called when msgBytes is received from peer.
|
||||
//
|
||||
// CONTRACT: msgBytes are not nil
|
||||
Receive(chID byte, peer Peer, msgBytes []byte)
|
||||
}
|
||||
|
||||
//--------------------------------------
|
||||
|
||||
Reference in New Issue
Block a user