Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Dispatcher ¶
type Dispatcher struct {
// contains filtered or unexported fields
}
A Dispatcher is a task that is responsible for taking a request, sending it to a subset of the darknodes, waiting for the corresponding results, and the finally aggregating the results into a single result to be returned to the client of the lightnode. The addresses of known darknodes are stored in a store that is shared by the `Updater`, which will periodically update the store so that the addresses of the known darkndoes are kept up to date.
type Iterator ¶
type Iterator interface {
Collect(id interface{}, cancel context.CancelFunc, responses <-chan jsonrpc.Response) jsonrpc.Response
}
Iterator reads response from the given channel, collects response and combines them to a single response depending on different strategies. It tries to cancel the ctx when it has the response.
func NewFirstResponseIterator ¶
func NewFirstResponseIterator() Iterator
NewFirstResponseIterator creates a new firstResponseIterator.
func NewMajorityResponseIterator ¶
func NewMajorityResponseIterator(logger logrus.FieldLogger) Iterator
NewMajorityResponseIterator returns a new majorityResponseIterator.