-
Notifications
You must be signed in to change notification settings - Fork 330
/
Copy pathsubscriber.go
23 lines (20 loc) · 967 Bytes
/
subscriber.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
package dispatcher
import (
"context"
"github.com/iotexproject/go-pkgs/hash"
"github.com/iotexproject/iotex-proto/golang/iotexrpc"
"github.com/iotexproject/iotex-proto/golang/iotextypes"
"github.com/libp2p/go-libp2p/core/peer"
)
// Subscriber is the dispatcher subscriber interface
type Subscriber interface {
ReportFullness(context.Context, iotexrpc.MessageType, float32)
HandleAction(context.Context, *iotextypes.Action) error
HandleBlock(context.Context, string, *iotextypes.Block) error
HandleSyncRequest(context.Context, peer.AddrInfo, *iotexrpc.BlockSync) error
HandleConsensusMsg(*iotextypes.ConsensusMessage) error
HandleNodeInfoRequest(context.Context, peer.AddrInfo, *iotextypes.NodeInfoRequest) error
HandleNodeInfo(context.Context, string, *iotextypes.NodeInfo) error
HandleActionRequest(ctx context.Context, peer peer.AddrInfo, actHash hash.Hash256) error
HandleActionHash(ctx context.Context, actHash hash.Hash256, from string) error
}