handler

package
v0.0.0-...-fe632b3 Latest Latest
Warning

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

Go to latest
Published: Feb 26, 2020 License: Apache-2.0 Imports: 24 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewEnv

func NewEnv(cfgID int64, name string, gp *pool.GoroutinePool) adapter.Env

NewEnv returns a new environment instance.

Types

type Entry

type Entry struct {
	// Name of the Handler
	Name string

	// Handler is the initialized Handler object.
	Handler adapter.Handler

	// AdapterName that was used to create this Entry.
	AdapterName string

	// Signature of the configuration used to create this entry.
	Signature signature
	// contains filtered or unexported fields
}

Entry in the handler table.

type Table

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

Table contains a set of instantiated and configured adapter handlers.

func Empty

func Empty() *Table

Empty returns an empty table instance.

func NewTable

func NewTable(old *Table, snapshot *config.Snapshot, gp *pool.GoroutinePool) *Table

NewTable returns a new table, based on the given config snapshot. The table will re-use existing handlers as much as possible from the old table.

func (*Table) Cleanup

func (t *Table) Cleanup(current *Table)

Cleanup the old table by selectively closing handlers that are not used in the given table. The cleanup method is called on the "old" table, and the "current" table (that is based on the new config) is passed as a parameter. The Cleanup method selectively closes all adapters that are not used by the current table. This method will use perf counters on current will be used, instead of the perf counters on t. This ensures that appropriate config id dimension is used when reporting metrics.

func (*Table) Get

func (t *Table) Get(handlerName string) (Entry, bool)

Get returns the entry for a Handler with the given name, if it exists.

Jump to

Keyboard shortcuts

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