mirror of
https://github.com/tendermint/tendermint.git
synced 2026-08-28 11:56:15 +00:00
add deprecation notices
This commit is contained in:
+4
-2
@@ -47,7 +47,9 @@ type Reactor interface {
|
||||
//
|
||||
// Only one of Receive or ReceiveEnvelope are called per message. If ReceiveEnvelope
|
||||
// is implemented, it will be used, otherwise the switch will fallback to
|
||||
// using Receive. Receive will be replaced by ReceiveEnvelope in a future version
|
||||
// using Receive.
|
||||
// Deprecated: Reactors looking to receive data from a peer should implement ReceiveEnvelope.
|
||||
// Receive will be deprecated in favor of ReceiveEnvelope in v0.38.
|
||||
Receive(chID byte, peer Peer, msgBytes []byte)
|
||||
}
|
||||
|
||||
@@ -81,6 +83,6 @@ func (br *BaseReactor) SetSwitch(sw *Switch) {
|
||||
func (*BaseReactor) GetChannels() []*conn.ChannelDescriptor { return nil }
|
||||
func (*BaseReactor) AddPeer(peer Peer) {}
|
||||
func (*BaseReactor) RemovePeer(peer Peer, reason interface{}) {}
|
||||
func (*BaseReactor) ReceiveEnvelope(e Envelope) {}
|
||||
func (*BaseReactor) ReceiveEnvelope(e Envelope) {}
|
||||
func (*BaseReactor) Receive(chID byte, peer Peer, msgBytes []byte) {}
|
||||
func (*BaseReactor) InitPeer(peer Peer) Peer { return peer }
|
||||
|
||||
@@ -40,7 +40,12 @@ type Peer interface {
|
||||
SendEnvelope(Envelope) bool
|
||||
TrySendEnvelope(Envelope) bool
|
||||
|
||||
// Deprecated: entities looking to act as peers should implement SendEnvelope instead.
|
||||
// Send will be removed in v0.38.
|
||||
Send(byte, []byte) bool
|
||||
|
||||
// Deprecated: entities looking to act as peers should implement TrySendEnvelope instead.
|
||||
// TrySend will be removed in v0.38.
|
||||
TrySend(byte, []byte) bool
|
||||
|
||||
Set(string, interface{})
|
||||
|
||||
@@ -300,6 +300,9 @@ func (sw *Switch) BroadcastEnvelope(e Envelope) chan bool {
|
||||
// Broadcasts sends to the peers using the Send method.
|
||||
//
|
||||
// NOTE: Broadcast uses goroutines, so order of broadcast may not be preserved.
|
||||
//
|
||||
// Deprecated: code looking to broadcast data to all peers should use BroadcastEnvelope.
|
||||
// Broadcast will be removed in 0.38.
|
||||
func (sw *Switch) Broadcast(chID byte, msgBytes []byte) chan bool {
|
||||
sw.Logger.Debug("Broadcast", "channel", chID)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user