Documentation ¶
Index ¶
Constants ¶
const ( Name = "PHOS" Version = "v0.3.3" )
BINARY-PHOS
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ErrDoneFunc ¶ added in v0.1.1
type ErrorType ¶
type ErrorType uint64
ErrorType for PHOS Error
const ( TimeoutErr ErrorType HandlerErr CtxErr )
type Option ¶
type Option func(o *Options)
Option for PHOS
func WithContext ¶
WithContext will set context for PHOS
func WithErrDoneFunc ¶ added in v0.1.1
func WithErrDoneFunc(fn ErrDoneFunc) Option
WithErrDoneFunc will set err done function for PHOS which will be called when ctx done happened Note: You should use it will WithContext, otherwise it will not work
func WithErrHandleFunc ¶
func WithErrHandleFunc(fn ErrHandleFunc) Option
WithErrHandleFunc will set error handle function for PHOS which will be called when handle error happened
func WithErrTimeoutFunc ¶
func WithErrTimeoutFunc(fn ErrTimeoutFunc) Option
WithErrTimeoutFunc will set error timeout function for PHOS which will be called when timeout error happened
func WithTimeout ¶
WithTimeout will set timeout for the handler chain execution (not just for each handler)
type Options ¶
type Options struct { Ctx context.Context Zero bool Timeout time.Duration ErrHandleFunc ErrHandleFunc ErrTimeoutFunc ErrTimeoutFunc ErrDoneFunc ErrDoneFunc }
Options for PHOS
type Phos ¶
type Phos[T any] struct { In chan<- T Out <-chan Result[T] // contains filtered or unexported fields }
Phos short for Phosphophyllite PHOS is a channel with internal handler chain
func (*Phos[T]) Close ¶ added in v0.2.1
func (ph *Phos[T]) Close()
Close PHOS channel Note: You should not close In channel manually before or after calling Close