Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DBNotification ¶ added in v0.29.0
type DBNotification struct {
Action DBNotificationKind `json:"action"`
LeaderID string `json:"leader_id"`
}
type DBNotificationKind ¶ added in v0.29.0
type DBNotificationKind string
const ( DBNotificationKindRequestResign DBNotificationKind = "request_resign" DBNotificationKindResigned DBNotificationKind = "resigned" )
type Elector ¶
type Elector struct {
baseservice.BaseService
startstop.BaseStartStop
// contains filtered or unexported fields
}
func NewElector ¶
func NewElector(archetype *baseservice.Archetype, exec riverdriver.Executor, notifier *notifier.Notifier, config *Config) *Elector
NewElector returns an Elector using the given adapter. The name should correspond to the name of the database + schema combo and should be shared across all Clients running with that combination. The id should be unique to the Client.
func (*Elector) Listen ¶
func (e *Elector) Listen() *Subscription
type Notification ¶
type Subscription ¶
type Subscription struct {
// contains filtered or unexported fields
}
func (*Subscription) C ¶
func (s *Subscription) C() <-chan *Notification
func (*Subscription) Unlisten ¶
func (s *Subscription) Unlisten()
Click to show internal directories.
Click to hide internal directories.