bgworker

package
v2.3.8+incompatible Latest Latest
Warning

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

Go to latest
Published: Aug 2, 2018 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Overview

Package bgworker provides interface for bgworker plugins. A bgworker plugin has to implement the following function. NewBgWorker(config map[string]interface{}) (BgWorker, error)

Background workers run under the marketstore server by implementing the interface, started at the very beginning of the server lifecycle before the query interface is started, but internal state shuold be fledged. The server does not handle panics that happen within the plugin. A plugin can recover from panics, but be careful not to screw the server state if touching internal API. It is often better to just let it go.

Configuration is as follows.

bgworkers:
  - module: xxxWorker.so
    name: datafeed
    config: <according to the plulgin>

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BgWorker

type BgWorker interface {
	Run()
}

BgWorker implements Run(). It will be running under a separate goroutine.

func Load

func Load(loader SymbolLoader, config map[string]interface{}) (BgWorker, error)

Load loads new BgWorker instance using loader, and initializes it with config.

type SymbolLoader

type SymbolLoader interface {
	LoadSymbol(symbolName string) (interface{}, error)
}

SymbolLoader is an interface to retrieve symbol object from plugin

Jump to

Keyboard shortcuts

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