Documentation ¶
Index ¶
- Variables
- type ConnectivityInfo
- type Manager
- func (m *Manager) AddTransport(c structs.ConnTransport) error
- func (m *Manager) AttachToMux(mux *http.ServeMux)
- func (m *Manager) GetAllWorkers() map[string]structs.WorkerNetworkStatic
- func (m *Manager) GetWorkers(kind string) []structs.WorkerInfo
- func (m *Manager) Register(id, network, chain string, connInfo structs.WorkerConnection) error
- func (m *Manager) Send(trs []structs.TaskRequest) (*structs.Await, error)
- func (m *Manager) Unregister(id, kind, chain, version string) error
- type Network
- type PingInfo
- type RoundRobinWorkers
- func (rrw *RoundRobinWorkers) AddWorker(id string, stream *structs.StreamAccess) error
- func (rrw *RoundRobinWorkers) BringOnline(id string) error
- func (rrw *RoundRobinWorkers) Close(id string) error
- func (rrw *RoundRobinWorkers) GetWorker(id string) (twi structs.TaskWorkerInfo, ok bool)
- func (rrw *RoundRobinWorkers) GetWorkers() structs.TaskWorkerRecordInfo
- func (rrw *RoundRobinWorkers) Ping(ctx context.Context, id string) (time.Duration, error)
- func (rrw *RoundRobinWorkers) Reconnect(ctx context.Context, logger *zap.Logger, id string) error
- func (rrw *RoundRobinWorkers) SendNext(tr structs.TaskRequest, aw *structs.Await) (failedWorkerID string, err error)
- func (rrw *RoundRobinWorkers) SendToWorker(id string, tr structs.TaskRequest, aw *structs.Await) error
- type WorkersPool
Constants ¶
This section is empty.
Variables ¶
Functions ¶
This section is empty.
Types ¶
type ConnectivityInfo ¶
type Manager ¶
type Manager struct { ID string // contains filtered or unexported fields }
func NewManager ¶
NewManager is Manager constructor
func (*Manager) AddTransport ¶
func (m *Manager) AddTransport(c structs.ConnTransport) error
AddTransport for connectivity
func (*Manager) AttachToMux ¶
func (*Manager) GetAllWorkers ¶
func (m *Manager) GetAllWorkers() map[string]structs.WorkerNetworkStatic
GetAllWorkers returns static list of workers
func (*Manager) GetWorkers ¶
func (m *Manager) GetWorkers(kind string) []structs.WorkerInfo
GetWorkers gets workers of kind
func (*Manager) Register ¶
func (m *Manager) Register(id, network, chain string, connInfo structs.WorkerConnection) error
Register new worker in Manager
func (*Manager) Unregister ¶
Unregister unregistring worker
type PingInfo ¶
type PingInfo struct { ID string `json:"id"` Network string `json:"network"` ChainID string `json:"chain_id"` Connectivity ConnectivityInfo `json:"connectivity"` }
PingInfo contract is defined here
type RoundRobinWorkers ¶
type RoundRobinWorkers struct {
// contains filtered or unexported fields
}
func NewRoundRobinWorkers ¶
func NewRoundRobinWorkers() *RoundRobinWorkers
func (*RoundRobinWorkers) AddWorker ¶
func (rrw *RoundRobinWorkers) AddWorker(id string, stream *structs.StreamAccess) error
func (*RoundRobinWorkers) BringOnline ¶
func (rrw *RoundRobinWorkers) BringOnline(id string) error
BringOnline Brings worker Online, removing duplicates
func (*RoundRobinWorkers) Close ¶
func (rrw *RoundRobinWorkers) Close(id string) error
Close closes worker of given id
func (*RoundRobinWorkers) GetWorker ¶
func (rrw *RoundRobinWorkers) GetWorker(id string) (twi structs.TaskWorkerInfo, ok bool)
func (*RoundRobinWorkers) GetWorkers ¶
func (rrw *RoundRobinWorkers) GetWorkers() structs.TaskWorkerRecordInfo
GetWorkers returns current workers information
func (*RoundRobinWorkers) SendNext ¶
func (rrw *RoundRobinWorkers) SendNext(tr structs.TaskRequest, aw *structs.Await) (failedWorkerID string, err error)
func (*RoundRobinWorkers) SendToWorker ¶ added in v0.4.0
func (rrw *RoundRobinWorkers) SendToWorker(id string, tr structs.TaskRequest, aw *structs.Await) error
SendToWoker sends task to worker
type WorkersPool ¶
type WorkersPool interface { AddWorker(id string, stream *structs.StreamAccess) error SendNext(tr structs.TaskRequest, aw *structs.Await) (failedWorkerID string, err error) Ping(ctx context.Context, id string) (time.Duration, error) Close(id string) error BringOnline(id string) error Reconnect(ctx context.Context, logger *zap.Logger, id string) error GetWorker(id string) (twi structs.TaskWorkerInfo, ok bool) GetWorkers() structs.TaskWorkerRecordInfo SendToWorker(id string, tr structs.TaskRequest, aw *structs.Await) error }
Click to show internal directories.
Click to hide internal directories.