event

package
v0.30.3 Latest Latest
Warning

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

Go to latest
Published: Apr 5, 2020 License: Apache-2.0 Imports: 9 Imported by: 46

Documentation

Index

Constants

View Source
const (
	EventTypeKey   = "EventType"
	EventIDKey     = "EventID"
	MessageTypeKey = "MessageType"
	TxHashKey      = "TxHash"
	HeightKey      = "Height"
	IndexKey       = "Index"
	StackDepthKey  = "StackDepth"
	AddressKey     = "Address"
)
View Source
const DefaultEventBufferCapacity = 2 << 10

Variables

This section is empty.

Functions

func GenSubID added in v0.20.0

func GenSubID() string

func QueryForEventID added in v0.18.0

func QueryForEventID(eventID string) query.Queryable

Get a query that matches events with a specific eventID

Types

type Emitter added in v0.18.0

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

Emitter has methods for working with events

func NewEmitter added in v0.18.0

func NewEmitter() *Emitter

NewEmitter initializes an emitter struct with a pubsubServer

func (*Emitter) Publish added in v0.25.0

func (em *Emitter) Publish(ctx context.Context, message interface{}, tags query.Tagged) error

Publish tells the emitter to publish with the given message and tags

func (*Emitter) SetLogger added in v0.25.0

func (em *Emitter) SetLogger(logger *logging.Logger)

SetLogger attaches a log handler to this emitter

func (*Emitter) Shutdown added in v0.25.0

func (em *Emitter) Shutdown(ctx context.Context) error

Shutdown stops the pubsubServer

func (*Emitter) Subscribe added in v0.25.0

func (em *Emitter) Subscribe(ctx context.Context, subscriber string, queryable query.Queryable, bufferSize int) (<-chan interface{}, error)

Subscribe tells the emitter to listen for messages on the given query

func (*Emitter) Unsubscribe added in v0.25.0

func (em *Emitter) Unsubscribe(ctx context.Context, subscriber string, queryable query.Queryable) error

Unsubscribe tells the emitter to stop listening for said messages

func (*Emitter) UnsubscribeAll added in v0.25.0

func (em *Emitter) UnsubscribeAll(ctx context.Context, subscriber string) error

UnsubscribeAll just stop listening for all messages

type EventID added in v0.24.0

type EventID string

func (EventID) MatchError added in v0.28.0

func (eid EventID) MatchError() error

func (EventID) Matches added in v0.24.0

func (eid EventID) Matches(tags query.Tagged) bool

func (EventID) String added in v0.24.0

func (eid EventID) String() string

Directories

Path Synopsis
This package was extracted from Tendermint Package pubsub implements a pub-sub model with a single publisher (Server) and multiple subscribers (clients).
This package was extracted from Tendermint Package pubsub implements a pub-sub model with a single publisher (Server) and multiple subscribers (clients).
Package query provides a parser for a custom query format: abci.invoice.number=22 AND abci.invoice.owner=Ivan See query.peg for the grammar, which is a https://en.wikipedia.org/wiki/Parsing_expression_grammar.
Package query provides a parser for a custom query format: abci.invoice.number=22 AND abci.invoice.owner=Ivan See query.peg for the grammar, which is a https://en.wikipedia.org/wiki/Parsing_expression_grammar.

Jump to

Keyboard shortcuts

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