Documentation ¶
Index ¶
- type Distributor
- func (d *Distributor) AddConsumer(consumer protocol.Consumer)
- func (d *Distributor) BlockFinalized(block *flow.Header)
- func (d *Distributor) BlockProcessable(block *flow.Header)
- func (d *Distributor) EpochCommittedPhaseStarted(epoch uint64, first *flow.Header)
- func (d *Distributor) EpochSetupPhaseStarted(epoch uint64, first *flow.Header)
- func (d *Distributor) EpochTransition(newEpoch uint64, first *flow.Header)
- type Heights
- type Noop
- func (n Noop) BlockFinalized(block *flow.Header)
- func (n Noop) BlockProcessable(block *flow.Header)
- func (n Noop) EpochCommittedPhaseStarted(epoch uint64, first *flow.Header)
- func (n Noop) EpochSetupPhaseStarted(epoch uint64, first *flow.Header)
- func (n Noop) EpochTransition(newEpoch uint64, first *flow.Header)
- type OnViewCallback
- type Views
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Distributor ¶
type Distributor struct {
// contains filtered or unexported fields
}
Distributor distributes events to a list of subscribers.
func NewDistributor ¶
func NewDistributor() *Distributor
NewDistributor returns a new events distributor.
func (*Distributor) AddConsumer ¶
func (d *Distributor) AddConsumer(consumer protocol.Consumer)
func (*Distributor) BlockFinalized ¶
func (d *Distributor) BlockFinalized(block *flow.Header)
func (*Distributor) BlockProcessable ¶
func (d *Distributor) BlockProcessable(block *flow.Header)
func (*Distributor) EpochCommittedPhaseStarted ¶
func (d *Distributor) EpochCommittedPhaseStarted(epoch uint64, first *flow.Header)
func (*Distributor) EpochSetupPhaseStarted ¶
func (d *Distributor) EpochSetupPhaseStarted(epoch uint64, first *flow.Header)
func (*Distributor) EpochTransition ¶
func (d *Distributor) EpochTransition(newEpoch uint64, first *flow.Header)
type Heights ¶
type Heights interface { // OnHeight registers the callback for the given height. OnHeight(height uint64, callback func()) }
Heights enables subscribing to specific heights. The callback is invoked when the given height is finalized.
type Noop ¶
type Noop struct{}
Noop is a no-op implementation of protocol.Events.
func (Noop) BlockFinalized ¶
func (Noop) BlockProcessable ¶
func (Noop) EpochCommittedPhaseStarted ¶
func (Noop) EpochSetupPhaseStarted ¶
type OnViewCallback ¶ added in v0.20.0
OnViewCallback is the type of callback triggered by view events.
type Views ¶ added in v0.20.0
type Views interface { // OnView registers the callback for the given view. OnView(view uint64, callback OnViewCallback) }
Views enables subscribing to specific views. The callback is invoked when the first block of the given view is finalized.
Click to show internal directories.
Click to hide internal directories.