beats: github.com/elastic/beats/libbeat/common/bus Index | Files

package bus

import "github.com/elastic/beats/libbeat/common/bus"

Index

Package Files

bus.go

type Bus Uses

type Bus interface {
    // Publish an event to the bus
    Publish(Event)

    // Subscribe to all events, filter them to the ones containing *all* the keys in filter
    Subscribe(filter ...string) Listener
}

Bus provides a common channel to emit and listen for Events

func New Uses

func New(name string) Bus

New initializes a new bus with the given name and returns it

func NewBusWithStore Uses

func NewBusWithStore(name string, size int) Bus

NewBusWithStore allows to create a buffered bus when producers send data without listeners being subscribed to them. size determines the size of the buffer.

type Event Uses

type Event common.MapStr

Event sent to the bus

type Listener Uses

type Listener interface {
    // Events channel
    Events() <-chan Event

    // Stop listening and removes itself from the bus
    Stop()
}

Listener retrieves Events from a Bus subscription until Stop is called

Package bus imports 3 packages (graph) and is imported by 128 packages. Updated 2018-10-05. Refresh now. Tools for package owners.