Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type RPCBroadcaster ¶
type RPCBroadcaster struct { Clients map[string]*RPCClient Log *zap.Logger Responses chan []interface{} // contains filtered or unexported fields }
RPCBroadcaster represents a generic RPC broadcaster.
func NewRPCBroadcaster ¶
func NewRPCBroadcaster(log *zap.Logger, sendTimeout time.Duration) *RPCBroadcaster
NewRPCBroadcaster returns a new RPC broadcaster instance.
func (*RPCBroadcaster) NewRPCClient ¶
func (r *RPCBroadcaster) NewRPCClient(addr string, method SendMethod, timeout time.Duration, ch chan []interface{}) *RPCClient
NewRPCClient returns a new rpc client for the provided address and method.
func (*RPCBroadcaster) SendParams ¶ added in v0.99.1
func (r *RPCBroadcaster) SendParams(params []interface{})
SendParams sends a request using all clients if the broadcaster is active.
func (*RPCBroadcaster) Shutdown ¶
func (r *RPCBroadcaster) Shutdown()
Shutdown implements oracle.Broadcaster. The same instance can't be Run again after the shutdown.
type RPCClient ¶
type RPCClient struct {
// contains filtered or unexported fields
}
RPCClient represent an rpc client for a single node.
type SendMethod ¶
SendMethod represents an rpc method for sending data to other nodes.
Click to show internal directories.
Click to hide internal directories.