Documentation ¶
Index ¶
- Variables
- type Handler
- type Parallel
- func (p *Parallel) Add(pipes ...*Pipeline) *Parallel
- func (p *Parallel) AddChildren(children ...*Parallel) *Parallel
- func (p *Parallel) Except(f interface{}, args ...interface{}) *Handler
- func (p *Parallel) NewChild() *Parallel
- func (p *Parallel) NewPipeline() *Pipeline
- func (p *Parallel) Register(f interface{}, args ...interface{}) *Handler
- func (p *Parallel) Run()
- func (p *Parallel) RunWithTimeOut(d time.Duration)
- type Pipeline
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrArgNotFunction = errors.New("argument type not function") //argument type not function ErrInArgLenNotMatch = errors.New("input arguments length not match") //input arguments length not match ErrOutArgLenNotMatch = errors.New("output arguments length not match") //output arguments length not match ErrRecvArgTypeNotPtr = errors.New("receiver argument type is not pointer") //receiver argument type is not pointer ErrRecvArgNil = errors.New("receiver argument must not be nil") //receiver argument must not be nil )
Functions ¶
This section is empty.
Types ¶
type Handler ¶
type Handler struct {
// contains filtered or unexported fields
}
Handler instance
func NewHandler ¶
func NewHandler(f interface{}, args ...interface{}) *Handler
NewHandler create a new Handler which contains a single function call
func (*Handler) OnExcept ¶
func (h *Handler) OnExcept(e interface{})
OnExcept will executed by parallel when application panic occur Note that the type of e is unknown.
func (*Handler) SetReceivers ¶
SetReceivers sets the receivers of return values
type Parallel ¶
type Parallel struct {
// contains filtered or unexported fields
}
Parallel instance, which executes pipelines by parallel
func (*Parallel) AddChildren ¶
AddChildren add children to parallel to handle dependency
func (*Parallel) Except ¶
Except set the exception handling routine, when unexpected panic occur this routine will be executed.
func (*Parallel) NewPipeline ¶
NewPipeline create a new pipeline of parallel
func (*Parallel) RunWithTimeOut ¶
RunWithTimeOut start up all the jobs, and time out after d duration
type Pipeline ¶
type Pipeline struct {
// contains filtered or unexported fields
}
Pipeline instance, which executes jobs by serial
Click to show internal directories.
Click to hide internal directories.