pubsub

package
v0.27.2-unicast-masque... Latest Latest
Warning

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

Go to latest
Published: Aug 18, 2022 License: AGPL-3.0 Imports: 4 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 a event consumer to the Distributor

func (*Distributor) OnBlockIncorporated

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

func (*Distributor) OnDoubleProposeDetected

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

func (*Distributor) OnDoubleVotingDetected

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

func (*Distributor) OnEnteringView

func (p *Distributor) OnEnteringView(view uint64, leader flow.Identifier)

func (*Distributor) OnEventProcessed

func (p *Distributor) OnEventProcessed()

func (*Distributor) OnFinalizedBlock

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

func (*Distributor) OnForkChoiceGenerated

func (p *Distributor) OnForkChoiceGenerated(curView uint64, selectedQC *flow.QuorumCertificate)

func (*Distributor) OnInvalidVoteDetected

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

func (*Distributor) OnProposingBlock

func (p *Distributor) OnProposingBlock(proposal *model.Proposal)

func (*Distributor) OnQcConstructedFromVotes

func (p *Distributor) OnQcConstructedFromVotes(curView uint64, qc *flow.QuorumCertificate)

func (*Distributor) OnQcIncorporated

func (p *Distributor) OnQcIncorporated(qc *flow.QuorumCertificate)

func (*Distributor) OnQcTriggeredViewChange

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

func (*Distributor) OnReachedTimeout

func (p *Distributor) OnReachedTimeout(timeout *model.TimerInfo)

func (*Distributor) OnReceiveProposal

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

func (*Distributor) OnReceiveVote

func (p *Distributor) OnReceiveVote(currentView uint64, vote *model.Vote)

func (*Distributor) OnStartingTimeout

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

func (*Distributor) OnVoteForInvalidBlockDetected added in v0.23.9

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

func (*Distributor) OnVoting

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

type FinalizationDistributor added in v0.17.6

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

FinalizationDistributor subscribes for 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) OnDoubleVotingDetected added in v0.17.6

func (p *FinalizationDistributor) OnDoubleVotingDetected(*model.Vote, *model.Vote)

func (*FinalizationDistributor) OnEnteringView added in v0.17.6

func (p *FinalizationDistributor) OnEnteringView(uint64, flow.Identifier)

func (*FinalizationDistributor) OnEventProcessed added in v0.17.6

func (p *FinalizationDistributor) OnEventProcessed()

func (*FinalizationDistributor) OnFinalizedBlock added in v0.17.6

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

func (*FinalizationDistributor) OnForkChoiceGenerated added in v0.17.6

func (p *FinalizationDistributor) OnForkChoiceGenerated(uint64, *flow.QuorumCertificate)

func (*FinalizationDistributor) OnInvalidVoteDetected added in v0.17.6

func (p *FinalizationDistributor) OnInvalidVoteDetected(*model.Vote)

func (*FinalizationDistributor) OnProposingBlock added in v0.17.6

func (p *FinalizationDistributor) OnProposingBlock(*model.Proposal)

func (*FinalizationDistributor) OnQcConstructedFromVotes added in v0.17.6

func (p *FinalizationDistributor) OnQcConstructedFromVotes(curView uint64, qc *flow.QuorumCertificate)

func (*FinalizationDistributor) OnQcIncorporated added in v0.17.6

func (p *FinalizationDistributor) OnQcIncorporated(*flow.QuorumCertificate)

func (*FinalizationDistributor) OnQcTriggeredViewChange added in v0.17.6

func (p *FinalizationDistributor) OnQcTriggeredViewChange(*flow.QuorumCertificate, uint64)

func (*FinalizationDistributor) OnReachedTimeout added in v0.17.6

func (p *FinalizationDistributor) OnReachedTimeout(*model.TimerInfo)

func (*FinalizationDistributor) OnReceiveProposal added in v0.17.6

func (p *FinalizationDistributor) OnReceiveProposal(uint64, *model.Proposal)

func (*FinalizationDistributor) OnReceiveVote added in v0.17.6

func (p *FinalizationDistributor) OnReceiveVote(uint64, *model.Vote)

func (*FinalizationDistributor) OnStartingTimeout added in v0.17.6

func (p *FinalizationDistributor) OnStartingTimeout(*model.TimerInfo)

func (*FinalizationDistributor) OnVoteForInvalidBlockDetected added in v0.23.9

func (p *FinalizationDistributor) OnVoteForInvalidBlockDetected(*model.Vote, *model.Proposal)

func (*FinalizationDistributor) OnVoting added in v0.17.6

func (p *FinalizationDistributor) OnVoting(*model.Vote)

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 OnQCCreatedConsumer added in v0.23.9

type OnQCCreatedConsumer = func(qc *flow.QuorumCertificate)

type QCCreatedDistributor added in v0.23.9

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

QCCreatedDistributor subscribes for qc created event from hotstuff and distributes it 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 OnQCCreatedConsumer)

func (*QCCreatedDistributor) OnQcConstructedFromVotes added in v0.23.9

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

Jump to

Keyboard shortcuts

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