event

package
v0.23.2 Latest Latest
Warning

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

Go to latest
Published: Dec 18, 2018 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.Builder

Get a query that matches events with a specific eventID

Types

type Emitter added in v0.18.0

type Emitter interface {
	Subscribable
	Publisher
	process.Process
}

func NewEmitter added in v0.18.0

func NewEmitter(logger *logging.Logger) Emitter

type Publisher added in v0.18.0

type Publisher interface {
	Publish(ctx context.Context, message interface{}, tag query.Tagged) error
}

func NewNoOpPublisher added in v0.18.0

func NewNoOpPublisher() Publisher

NoOpPublisher

type PublisherFunc added in v0.19.0

type PublisherFunc func(ctx context.Context, message interface{}, tags query.Tagged) error

func (PublisherFunc) Publish added in v0.19.0

func (pf PublisherFunc) Publish(ctx context.Context, message interface{}, tags query.Tagged) error

type Subscribable added in v0.18.0

type Subscribable interface {
	// Subscribe to all events matching query, which is a valid tmlibs Query. Blocking the out channel blocks the entire
	// pubsub.
	Subscribe(ctx context.Context, subscriber string, queryable query.Queryable, bufferSize int) (out <-chan interface{}, err error)
	// Unsubscribe subscriber from a specific query string. Note the subscribe channel must be drained.
	Unsubscribe(ctx context.Context, subscriber string, queryable query.Queryable) error
	UnsubscribeAll(ctx context.Context, subscriber string) error
}

TODO: manage the creation, closing, and draining of channels behind the interface rather than only closing. stop one subscriber from blocking everything!

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