rpcbroadcaster

package
v0.99.7 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 23, 2022 License: MIT Imports: 4 Imported by: 0

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) Run

func (r *RPCBroadcaster) Run()

Run implements oracle.Broadcaster.

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

type SendMethod func(*rpcclient.Client, []interface{}) error

SendMethod represents an rpc method for sending data to other nodes.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL