eventbus

package
v0.37.0-dev Latest Latest
Warning

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

Go to latest
Published: Jun 7, 2022 License: Apache-2.0 Imports: 9 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type EventBus

type EventBus struct {
	service.BaseService
	// contains filtered or unexported fields
}

EventBus is a common bus for all events going through the system. It is a type-aware wrapper around an underlying pubsub server. All events should be published via the bus.

func NewDefault

func NewDefault(l log.Logger) *EventBus

NewDefault returns a new event bus with default options.

func (*EventBus) NumClientSubscriptions

func (b *EventBus) NumClientSubscriptions(clientID string) int

func (*EventBus) NumClients

func (b *EventBus) NumClients() int

func (*EventBus) Observe

func (b *EventBus) Observe(ctx context.Context, observe func(tmpubsub.Message) error, queries ...*tmquery.Query) error

func (*EventBus) OnStart

func (b *EventBus) OnStart(ctx context.Context) error

func (*EventBus) OnStop

func (b *EventBus) OnStop()

func (*EventBus) Publish

func (b *EventBus) Publish(eventValue string, eventData types.EventData) error

func (*EventBus) PublishEventBlockSyncStatus

func (b *EventBus) PublishEventBlockSyncStatus(data types.EventDataBlockSyncStatus) error

func (*EventBus) PublishEventCompleteProposal

func (b *EventBus) PublishEventCompleteProposal(data types.EventDataCompleteProposal) error

func (*EventBus) PublishEventEvidenceValidated

func (b *EventBus) PublishEventEvidenceValidated(evidence types.EventDataEvidenceValidated) error

func (*EventBus) PublishEventLock

func (b *EventBus) PublishEventLock(data types.EventDataRoundState) error

func (*EventBus) PublishEventNewBlock

func (b *EventBus) PublishEventNewBlock(data types.EventDataNewBlock) error

func (*EventBus) PublishEventNewBlockHeader

func (b *EventBus) PublishEventNewBlockHeader(data types.EventDataNewBlockHeader) error

func (*EventBus) PublishEventNewEvidence

func (b *EventBus) PublishEventNewEvidence(evidence types.EventDataNewEvidence) error

func (*EventBus) PublishEventNewRound

func (b *EventBus) PublishEventNewRound(data types.EventDataNewRound) error

func (*EventBus) PublishEventNewRoundStep

func (b *EventBus) PublishEventNewRoundStep(data types.EventDataRoundState) error

func (*EventBus) PublishEventPolka

func (b *EventBus) PublishEventPolka(data types.EventDataRoundState) error

func (*EventBus) PublishEventRelock

func (b *EventBus) PublishEventRelock(data types.EventDataRoundState) error

func (*EventBus) PublishEventStateSyncStatus

func (b *EventBus) PublishEventStateSyncStatus(data types.EventDataStateSyncStatus) error

func (*EventBus) PublishEventTimeoutPropose

func (b *EventBus) PublishEventTimeoutPropose(data types.EventDataRoundState) error

func (*EventBus) PublishEventTimeoutWait

func (b *EventBus) PublishEventTimeoutWait(data types.EventDataRoundState) error

func (*EventBus) PublishEventTx

func (b *EventBus) PublishEventTx(data types.EventDataTx) error

PublishEventTx publishes tx event with events from Result. Note it will add predefined keys (EventTypeKey, TxHashKey). Existing events with the same keys will be overwritten.

func (*EventBus) PublishEventValidBlock

func (b *EventBus) PublishEventValidBlock(data types.EventDataRoundState) error

func (*EventBus) PublishEventValidatorSetUpdates

func (b *EventBus) PublishEventValidatorSetUpdates(data types.EventDataValidatorSetUpdates) error

func (*EventBus) PublishEventVote

func (b *EventBus) PublishEventVote(data types.EventDataVote) error

func (*EventBus) SubscribeWithArgs

func (b *EventBus) SubscribeWithArgs(ctx context.Context, args tmpubsub.SubscribeArgs) (Subscription, error)

func (*EventBus) Unsubscribe

func (b *EventBus) Unsubscribe(ctx context.Context, args tmpubsub.UnsubscribeArgs) error

func (*EventBus) UnsubscribeAll

func (b *EventBus) UnsubscribeAll(ctx context.Context, subscriber string) error

type Subscription

type Subscription interface {
	ID() string
	Next(context.Context) (tmpubsub.Message, error)
}

Subscription is a proxy interface for a pubsub Subscription.

Jump to

Keyboard shortcuts

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