pubsub

package
v0.30.3 Latest Latest
Warning

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

Go to latest
Published: Apr 12, 2023 License: AGPL-3.0 Imports: 6 Imported by: 10

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 distributes notifications to a list of subscribers (event consumers).

It allows thread-safe subscription of multiple consumers to events.

func NewDistributor

func NewDistributor() *Distributor

func (*Distributor) AddConsumer

func (p *Distributor) AddConsumer(consumer hotstuff.Consumer)

AddConsumer adds an event consumer to the Distributor

func (*Distributor) OnBlockIncorporated

func (p *Distributor) OnBlockIncorporated(block *model.Block)

func (*Distributor) OnCurrentViewDetails added in v0.29.6

func (p *Distributor) OnCurrentViewDetails(currentView, finalizedView uint64, currentLeader flow.Identifier)

func (*Distributor) OnDoubleProposeDetected

func (p *Distributor) OnDoubleProposeDetected(block1, block2 *model.Block)

func (*Distributor) OnDoubleTimeoutDetected added in v0.29.0

func (p *Distributor) OnDoubleTimeoutDetected(timeout *model.TimeoutObject, altTimeout *model.TimeoutObject)

func (*Distributor) OnDoubleVotingDetected

func (p *Distributor) OnDoubleVotingDetected(vote1, vote2 *model.Vote)

func (*Distributor) OnEventProcessed

func (p *Distributor) OnEventProcessed()

func (*Distributor) OnFinalizedBlock

func (p *Distributor) OnFinalizedBlock(block *model.Block)

func (*Distributor) OnInvalidTimeoutDetected added in v0.29.0

func (p *Distributor) OnInvalidTimeoutDetected(err model.InvalidTimeoutError)

func (*Distributor) OnInvalidVoteDetected

func (p *Distributor) OnInvalidVoteDetected(err model.InvalidVoteError)

func (*Distributor) OnLocalTimeout added in v0.29.0

func (p *Distributor) OnLocalTimeout(currentView uint64)

func (*Distributor) OnOwnProposal added in v0.29.0

func (p *Distributor) OnOwnProposal(proposal *flow.Header, targetPublicationTime time.Time)

func (*Distributor) OnOwnTimeout added in v0.29.0

func (p *Distributor) OnOwnTimeout(timeout *model.TimeoutObject)

func (*Distributor) OnOwnVote added in v0.29.0

func (p *Distributor) OnOwnVote(blockID flow.Identifier, view uint64, sigData []byte, recipientID flow.Identifier)

func (*Distributor) OnPartialTc added in v0.29.0

func (p *Distributor) OnPartialTc(currentView uint64, partialTc *hotstuff.PartialTcCreated)

func (*Distributor) OnQcTriggeredViewChange

func (p *Distributor) OnQcTriggeredViewChange(oldView uint64, newView uint64, qc *flow.QuorumCertificate)

func (*Distributor) OnReceiveProposal

func (p *Distributor) OnReceiveProposal(currentView uint64, proposal *model.Proposal)

func (*Distributor) OnReceiveQc added in v0.29.0

func (p *Distributor) OnReceiveQc(currentView uint64, qc *flow.QuorumCertificate)

func (*Distributor) OnReceiveTc added in v0.29.0

func (p *Distributor) OnReceiveTc(currentView uint64, tc *flow.TimeoutCertificate)

func (*Distributor) OnStart added in v0.29.0

func (p *Distributor) OnStart(currentView uint64)

func (*Distributor) OnStartingTimeout

func (p *Distributor) OnStartingTimeout(timerInfo model.TimerInfo)

func (*Distributor) OnTcTriggeredViewChange added in v0.29.0

func (p *Distributor) OnTcTriggeredViewChange(oldView uint64, newView uint64, tc *flow.TimeoutCertificate)

func (*Distributor) OnTimeoutProcessed added in v0.29.6

func (p *Distributor) OnTimeoutProcessed(timeout *model.TimeoutObject)

func (*Distributor) OnViewChange added in v0.29.0

func (p *Distributor) OnViewChange(oldView, newView uint64)

func (*Distributor) OnVoteForInvalidBlockDetected added in v0.23.9

func (p *Distributor) OnVoteForInvalidBlockDetected(vote *model.Vote, invalidProposal *model.Proposal)

func (*Distributor) OnVoteProcessed added in v0.29.6

func (p *Distributor) OnVoteProcessed(vote *model.Vote)

type FinalizationDistributor added in v0.17.6

type FinalizationDistributor struct {
	notifications.NoopConsumer
	// contains filtered or unexported fields
}

FinalizationDistributor ingests finalization events from hotstuff and distributes it to subscribers.

func NewFinalizationDistributor added in v0.17.6

func NewFinalizationDistributor() *FinalizationDistributor

func (*FinalizationDistributor) AddConsumer added in v0.19.0

func (p *FinalizationDistributor) AddConsumer(consumer hotstuff.FinalizationConsumer)

func (*FinalizationDistributor) AddOnBlockFinalizedConsumer added in v0.17.6

func (p *FinalizationDistributor) AddOnBlockFinalizedConsumer(consumer OnBlockFinalizedConsumer)

func (*FinalizationDistributor) AddOnBlockIncorporatedConsumer added in v0.17.6

func (p *FinalizationDistributor) AddOnBlockIncorporatedConsumer(consumer OnBlockIncorporatedConsumer)

func (*FinalizationDistributor) OnBlockIncorporated added in v0.17.6

func (p *FinalizationDistributor) OnBlockIncorporated(block *model.Block)

func (*FinalizationDistributor) OnDoubleProposeDetected added in v0.17.6

func (p *FinalizationDistributor) OnDoubleProposeDetected(block1, block2 *model.Block)

func (*FinalizationDistributor) OnFinalizedBlock added in v0.17.6

func (p *FinalizationDistributor) OnFinalizedBlock(block *model.Block)

type OnBlockFinalizedConsumer added in v0.17.6

type OnBlockFinalizedConsumer = func(block *model.Block)

type OnBlockIncorporatedConsumer added in v0.17.6

type OnBlockIncorporatedConsumer = func(block *model.Block)

type QCCreatedDistributor added in v0.23.9

type QCCreatedDistributor struct {
	// contains filtered or unexported fields
}

QCCreatedDistributor ingests events about QC creation from hotstuff and distributes them to subscribers. Objects are concurrency safe. NOTE: it can be refactored to work without lock since usually we never subscribe after startup. Mostly list of observers is static.

func NewQCCreatedDistributor added in v0.23.9

func NewQCCreatedDistributor() *QCCreatedDistributor

func (*QCCreatedDistributor) AddConsumer added in v0.23.9

func (d *QCCreatedDistributor) AddConsumer(consumer hotstuff.QCCreatedConsumer)

func (*QCCreatedDistributor) OnQcConstructedFromVotes added in v0.23.9

func (d *QCCreatedDistributor) OnQcConstructedFromVotes(qc *flow.QuorumCertificate)

type TimeoutCollectorDistributor added in v0.29.0

type TimeoutCollectorDistributor struct {
	// contains filtered or unexported fields
}

TimeoutCollectorDistributor ingests events from hotstuff and distributes them to subscribers. Concurrently safe TODO: investigate if this can be updated using atomics to prevent locking on mutex since we always add all consumers before delivering events.

func NewTimeoutCollectorDistributor added in v0.29.0

func NewTimeoutCollectorDistributor() *TimeoutCollectorDistributor

func (*TimeoutCollectorDistributor) AddConsumer added in v0.29.0

func (*TimeoutCollectorDistributor) OnNewQcDiscovered added in v0.29.0

func (d *TimeoutCollectorDistributor) OnNewQcDiscovered(qc *flow.QuorumCertificate)

func (*TimeoutCollectorDistributor) OnNewTcDiscovered added in v0.29.0

func (d *TimeoutCollectorDistributor) OnNewTcDiscovered(tc *flow.TimeoutCertificate)

func (*TimeoutCollectorDistributor) OnPartialTcCreated added in v0.29.0

func (d *TimeoutCollectorDistributor) OnPartialTcCreated(view uint64, newestQC *flow.QuorumCertificate, lastViewTC *flow.TimeoutCertificate)

func (*TimeoutCollectorDistributor) OnTcConstructedFromTimeouts added in v0.29.0

func (d *TimeoutCollectorDistributor) OnTcConstructedFromTimeouts(tc *flow.TimeoutCertificate)

Jump to

Keyboard shortcuts

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