beats: Index | Files

package bus

import ""


Package Files


type Bus Uses

type Bus interface {
    // Publish an event to the bus

    // 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(log *logp.Logger, name string) Bus

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

func NewBusWithStore Uses

func NewBusWithStore(log *logp.Logger, 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

Listener retrieves Events from a Bus subscription until Stop is called

Package bus imports 3 packages (graph) and is imported by 299 packages. Updated 2020-03-06. Refresh now. Tools for package owners.