handle

package
v0.0.0-...-2f7b494 Latest Latest
Warning

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

Go to latest
Published: Jun 19, 2023 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const ErrNonErrorPanic = "panic: %v"

ErrNonErrorPanic is used to format a recover result that does not support the standard error interface

Variables

This section is empty.

Functions

This section is empty.

Types

type Handler

type Handler func(actor.Context, actor.Message) bool

Handler is a partial actor.Actor that can be composed with others

func All

func All(first Handler, rest ...Handler) Handler

All is a Handler composition that will only return true if all of its constituent Handlers returns true

func And

func And(l Handler, r Handler) Handler

And constructs a Handler that performs the left Handler, and if it returns true will return the result of performing the right Handler

func Any

func Any(first Handler, rest ...Handler) Handler

Any is a Handler composition that will return true the first time any of its constituent Handlers returns true

func Or

func Or(l Handler, r Handler) Handler

Or constructs a Handler that performs the left Handler, and if it returns false will return the result of performing the right Handler

func Panic

func Panic(h Handler) Handler

Panic wraps a Handler and will catch any panic value that is recovered in executing that Handler. These will be reported as a report.Error

func UnhandledMessage

func UnhandledMessage(h Handler) Handler

UnhandledMessage wraps a Handler and will report a report.DeadLetter if that Handler returns false

func (Handler) New

func (h Handler) New(_ ...actor.Arg) actor.Actor

New allows a Handler to act as a Factory of itself. Args are ignored and both panic and dead letter reporting are performed

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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