observer

package
v0.0.0-...-6bdf688 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DefaultObserver

type DefaultObserver struct {
	// contains filtered or unexported fields
}

func NewObserver

func NewObserver(name string) *DefaultObserver

func (*DefaultObserver) Publish

func (o *DefaultObserver) Publish(event string, data interface{}) error

func (*DefaultObserver) PublishTimeout

func (o *DefaultObserver) PublishTimeout(event string, data interface{}, timeout time.Duration) error

func (*DefaultObserver) String

func (o *DefaultObserver) String() string

func (*DefaultObserver) Subscribe

func (o *DefaultObserver) Subscribe(event string, outputChan chan interface{})

func (*DefaultObserver) Unsubscribe

func (o *DefaultObserver) Unsubscribe(event string, outputChan chan interface{}) error

Stop observing the specified event on the provided output channel

func (*DefaultObserver) UnsubscribeAll

func (o *DefaultObserver) UnsubscribeAll(event string) error

Stop observing the specified event on all channels

type Observer

type Observer interface {
	Subscribe(event string, outputChan chan interface{})
	Unsubscribe(event string, outputChan chan interface{}) error
	Publish(event string, data interface{}) error
}

Jump to

Keyboard shortcuts

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