process

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Aug 1, 2019 License: MIT Imports: 9 Imported by: 0

Documentation

Overview

Package process provides engine components that handle messages that are routed to process message handlers.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Controller

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

Controller is an implementation of engine.Controller for dogma.ProcessMessageHandler implementations.

func NewController

NewController returns a new controller for the given handler.

func (*Controller) Handle

func (c *Controller) Handle(
	ctx context.Context,
	obs fact.Observer,
	now time.Time,
	env *envelope.Envelope,
) ([]*envelope.Envelope, error)

Handle handles a message.

func (*Controller) Name

func (c *Controller) Name() string

Name returns the name of the handler that is managed by this controller.

func (*Controller) Reset

func (c *Controller) Reset()

Reset clears the state of the controller.

func (*Controller) Tick

func (c *Controller) Tick(
	ctx context.Context,
	obs fact.Observer,
	now time.Time,
) ([]*envelope.Envelope, error)

Tick returns the timeout messages that are ready to be handled.

func (*Controller) Type

func (c *Controller) Type() handler.Type

Type returns handler.ProcessType.

Jump to

Keyboard shortcuts

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