dispatcher

package
v0.0.0-...-712e5b7 Latest Latest
Warning

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

Go to latest
Published: Aug 17, 2017 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Dispatcher

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

Dispatcher fans out incoming events based on their reflect.Type. One or more UpdateHandler functions can be registered for each type.

The Dispatcher supports rudimentary filtering: UpdateHandlers are called in the order they were added. Earlier handlers can return filterOut=true to prevent further handlers being called.

func NewDispatcher

func NewDispatcher() *Dispatcher

NewDispatcher creates a Dispatcher with all its event handlers set to no-ops.

func (*Dispatcher) OnDatamodelStatus

func (d *Dispatcher) OnDatamodelStatus(status api.SyncStatus)

func (*Dispatcher) OnStatusUpdated

func (d *Dispatcher) OnStatusUpdated(status api.SyncStatus)

func (*Dispatcher) OnUpdate

func (d *Dispatcher) OnUpdate(update api.Update) (filterOut bool)

func (*Dispatcher) OnUpdates

func (d *Dispatcher) OnUpdates(updates []api.Update)

func (*Dispatcher) Register

func (d *Dispatcher) Register(keyExample model.Key, receiver UpdateHandler)

func (*Dispatcher) RegisterStatusHandler

func (d *Dispatcher) RegisterStatusHandler(handler StatusHandler)

type StatusHandler

type StatusHandler func(status api.SyncStatus)

type UpdateHandler

type UpdateHandler func(update api.Update) (filterOut bool)

Jump to

Keyboard shortcuts

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