Documentation ¶
Overview ¶
Package interfaces provides all the interfaces used in Rafty. They have been secluded in this package in order to avoid circular imports.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Discoverer ¶
type Discoverer interface { // NewServers returns a channel that is used to notify Rafty that there is a // new list of servers available. Although not required, it is better that // notifications are sent only when the list of servers has changed. NewServers() chan struct{} // GetServers returns the current list of servers. GetServers() []raft.Server }
Discoverer is the mechanism Rafty uses to discover other Rafty processes.
type Distributor ¶
type Distributor[T any, T2 Work[T]] interface { Distribute(servers []raft.Server, works []T2) map[raft.ServerID][]T2 }
Distributor is the mechanism that allows to distibute work across the members of the Raft cluster that constitutes Rafty.
type Finalizer ¶
type Finalizer interface {
Done() chan struct{}
}
Finalizer interface is used to finalize the discovery process. In the event of a Rafty process being stopped, if the Discoverer also implements Finalizer, Rafty will call Done() to allow the Discoverer to perform any cleanup required before the process exits.
type Foreman ¶
type Foreman[T any, T2 Work[T]] interface { // Start is called on the process that has been elected as the leader by the // Raft Cluster. Start() // Stop is called in the event we lose leadership. Stop() // NewWorks returns a channel that is used to notify Rafty that there is new // works available. NewWorks() chan struct{} // GetWorks returns the current list of work. GetWorks() []T2 }
Formeman is the mechanism Rafty uses to retrieve work.