Help us shape the future of Go! Take the 2026 Go Developer Survey

events

package
v0.38.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 21, 2025 License: AGPL-3.0 Imports: 4 Imported by: 6

Documentation

Index

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 implements the `protocol.Consumer` interface for ingesting notifications emitted by the protocol state. It distributes the notifications to all registered consumers.

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, certifyingQC *flow.QuorumCertificate)

func (*Distributor) EpochCommittedPhaseStarted

func (d *Distributor) EpochCommittedPhaseStarted(epoch uint64, first *flow.Header)

func (*Distributor) EpochExtended added in v0.37.1

func (d *Distributor) EpochExtended(epochCounter uint64, header *flow.Header, extension flow.EpochExtension)

func (*Distributor) EpochFallbackModeExited added in v0.37.1

func (d *Distributor) EpochFallbackModeExited(epochCounter uint64, header *flow.Header)

func (*Distributor) EpochFallbackModeTriggered added in v0.37.1

func (d *Distributor) EpochFallbackModeTriggered(epochCounter uint64, header *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 EventLogger added in v0.35.17

type EventLogger struct {
	Noop // satisfy protocol events consumer interface
	// contains filtered or unexported fields
}

func NewEventLogger added in v0.35.17

func NewEventLogger(logger zerolog.Logger) *EventLogger

func (EventLogger) EpochCommittedPhaseStarted added in v0.35.17

func (p EventLogger) EpochCommittedPhaseStarted(currentEpochCounter uint64, header *flow.Header)

func (EventLogger) EpochSetupPhaseStarted added in v0.35.17

func (p EventLogger) EpochSetupPhaseStarted(currentEpochCounter uint64, header *flow.Header)

func (EventLogger) EpochTransition added in v0.35.17

func (p EventLogger) EpochTransition(newEpochCounter uint64, header *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.Consumer.

func NewNoop

func NewNoop() *Noop

func (Noop) ActiveClustersChanged added in v0.31.0

func (n Noop) ActiveClustersChanged(flow.ChainIDList)

func (Noop) BlockFinalized

func (n Noop) BlockFinalized(*flow.Header)

func (Noop) BlockProcessable

func (n Noop) BlockProcessable(*flow.Header, *flow.QuorumCertificate)

func (Noop) EpochCommittedPhaseStarted

func (n Noop) EpochCommittedPhaseStarted(uint64, *flow.Header)

func (Noop) EpochExtended added in v0.37.1

func (n Noop) EpochExtended(uint64, *flow.Header, flow.EpochExtension)

func (Noop) EpochFallbackModeExited added in v0.37.1

func (n Noop) EpochFallbackModeExited(uint64, *flow.Header)

func (Noop) EpochFallbackModeTriggered added in v0.37.1

func (n Noop) EpochFallbackModeTriggered(uint64, *flow.Header)

func (Noop) EpochSetupPhaseStarted

func (n Noop) EpochSetupPhaseStarted(uint64, *flow.Header)

func (Noop) EpochTransition

func (n Noop) EpochTransition(uint64, *flow.Header)

type OnViewCallback added in v0.20.0

type OnViewCallback func(*flow.Header)

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.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL