Documentation ¶
Index ¶
- type Config
- type Handler
- type RPC
- func (e *RPC) Done() <-chan struct{}
- func (e *RPC) Process(channel channels.Channel, originID flow.Identifier, event interface{}) error
- func (e *RPC) ProcessLocal(event interface{}) error
- func (e *RPC) Ready() <-chan struct{}
- func (e *RPC) Submit(channel channels.Channel, originID flow.Identifier, event interface{})
- func (e *RPC) SubmitLocal(event interface{})
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Handler ¶
type Handler struct {
// contains filtered or unexported fields
}
Handler handles the GRPC calls from a client
func NewHandler ¶
func (Handler) Subscribe ¶
func (h Handler) Subscribe(_ *ghost.SubscribeRequest, stream ghost.GhostNodeAPI_SubscribeServer) error
Subscribe streams ALL the libp2p network messages over GRPC
type RPC ¶
type RPC struct {
// contains filtered or unexported fields
}
RPC implements a gRPC server for the Ghost node
func New ¶
func New(net network.EngineRegistry, log zerolog.Logger, me module.Local, state protocol.State, config Config) (*RPC, error)
New returns a new RPC engine.
func (*RPC) Done ¶
func (e *RPC) Done() <-chan struct{}
Done returns a done channel that is closed once the engine has fully stopped. It sends a signal to stop the gRPC server, then closes the channel.
func (*RPC) Process ¶
Process processes the given event from the node with the given origin ID in a blocking manner. It returns the potential processing error when done.
func (*RPC) ProcessLocal ¶
ProcessLocal processes an event originating on the local node.
func (*RPC) Ready ¶
func (e *RPC) Ready() <-chan struct{}
Ready returns a ready channel that is closed once the engine has fully started. The RPC engine is ready when the gRPC server has successfully started.
func (*RPC) Submit ¶
func (e *RPC) Submit(channel channels.Channel, originID flow.Identifier, event interface{})
Submit submits the given event from the node with the given origin ID for processing in a non-blocking manner. It returns instantly and logs a potential processing error internally when done.
func (*RPC) SubmitLocal ¶
func (e *RPC) SubmitLocal(event interface{})
SubmitLocal submits an event originating on the local node.