dispatcher

package
v0.0.0-...-730bba4 Latest Latest
Warning

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

Go to latest
Published: Mar 12, 2018 License: Apache-2.0 Imports: 22 Imported by: 0

Documentation

Overview

Package dispatcher is used to dispatch incoming requests to one or more handlers. The main entry point is the Dispatcher struct, which implements the main runtime.Dispatcher interface.

Once the dispatcher receives a request, it acquires the current routing table, and uses it until the end of the request. Additionally, it acquires an executor from a pool, which is used to perform and track the parallel calls that will be performed against the handlers. The executors scatter the calls

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 is the runtime2 implementation of the runtime.Dispatcher interface.

func New

func New(identityAttribute string, handlerGP *pool.GoroutinePool, enableTracing bool) *Dispatcher

New returns a new Dispatcher instance. The Dispatcher instance is initialized with an empty routing table.

func (*Dispatcher) ChangeRoute

func (d *Dispatcher) ChangeRoute(new *routing.Table) *RoutingContext

ChangeRoute changes the routing table on the Dispatcher which, in turn, ends up creating a new RoutingContext.

func (*Dispatcher) Check

Check implementation of runtime.Dispatcher.

func (*Dispatcher) Preprocess

func (d *Dispatcher) Preprocess(ctx context.Context, bag attribute.Bag, responseBag *attribute.MutableBag) error

Preprocess implementation of runtime.Dispatcher.

func (*Dispatcher) Quota

Quota implementation of runtime.Dispatcher.

func (*Dispatcher) Report

func (d *Dispatcher) Report(ctx context.Context, bag attribute.Bag) error

Report implementation of runtime.Dispatcher.

type RoutingContext

type RoutingContext struct {
	// the routing table of this context.
	Routes *routing.Table
	// contains filtered or unexported fields
}

RoutingContext is the currently active dispatching context, based on a config snapshot. As config changes, the current/live RoutingContext also changes.

func (*RoutingContext) DecRef

func (t *RoutingContext) DecRef()

DecRef decreases the reference count on the RoutingContext.

func (*RoutingContext) GetRefs

func (t *RoutingContext) GetRefs() int32

GetRefs returns the current reference count on the dispatch context.

func (*RoutingContext) IncRef

func (t *RoutingContext) IncRef()

IncRef increases the reference count on the RoutingContext.

Jump to

Keyboard shortcuts

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