burrow: github.com/hyperledger/burrow/event Index | Files | Directories

package event

import "github.com/hyperledger/burrow/event"


Package Files

convention.go emitter.go


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

func GenSubID Uses

func GenSubID() string

func QueryForEventID Uses

func QueryForEventID(eventID string) query.Queryable

Get a query that matches events with a specific eventID

type Emitter Uses

type Emitter struct {
    // contains filtered or unexported fields

Emitter has methods for working with events

func NewEmitter Uses

func NewEmitter() *Emitter

NewEmitter initializes an emitter struct with a pubsubServer

func (*Emitter) Publish Uses

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 Uses

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

SetLogger attaches a log handler to this emitter

func (*Emitter) Shutdown Uses

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

Shutdown stops the pubsubServer

func (*Emitter) Subscribe Uses

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 Uses

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 Uses

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

UnsubscribeAll just stop listening for all messages

type EventID Uses

type EventID string

func (EventID) MatchError Uses

func (eid EventID) MatchError() error

func (EventID) Matches Uses

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

func (EventID) String Uses

func (eid EventID) String() string


pubsubThis package was extracted from Tendermint
queryPackage query provides a parser for a custom query format:

Package event imports 9 packages (graph) and is imported by 59 packages. Updated 2020-04-23. Refresh now. Tools for package owners.