engine

package
v0.32.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// Root holds the variable name used for the database variable.
	Root = "$"
)

Functions

This section is empty.

Types

type Engine

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

Engine holds a database variable, allowing updates and publishing changes.

func Start

func Start() *Engine

Start starts a new Engine.

func (*Engine) Hangup

func (e *Engine) Hangup()

Hangup hangs up on all observers.

func (*Engine) Observe

func (e *Engine) Observe(
	expr rel.Expr,
	onupdate func(rel.Value) error,
	onclose func(error),
) func()

Observe registers and returns an Observation on the given expression.

func (*Engine) Stop

func (e *Engine) Stop()

Stop stops the engine.

func (*Engine) Update

func (e *Engine) Update(expr rel.Expr) error

Update updates the database variable to equal the given expression.

Jump to

Keyboard shortcuts

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