async

package
v0.0.0-...-5020eea Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Error

type Error struct {
	Err   error
	Ctx   context.Context
	Event eh.Event
}

Error is an async error containing the error and the event.

func (Error) Error

func (e Error) Error() string

Error implements the Error method of the error interface.

type EventHandler

type EventHandler struct {
	eh.EventHandler
	// contains filtered or unexported fields
}

EventHandler is an async event handler middleware. It will run the event in a new go routine and report any errors to the error channel obtained by Errors().

func NewEventHandler

func NewEventHandler(h eh.EventHandler) *EventHandler

NewEventHandler creates a new EventHandler.

func (*EventHandler) Errors

func (h *EventHandler) Errors() <-chan Error

Errors returns an error channel where async handling errors are sent.

func (*EventHandler) HandleEvent

func (h *EventHandler) HandleEvent(ctx context.Context, event eh.Event) error

HandleEvent implements the HandleEvent method of the EventHandler interface.

Jump to

Keyboard shortcuts

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