Documentation ¶
Index ¶
- func Add(name string, item interface{})
- func OnExit(call func(*Orbit))
- func OnFail(call func(*Orbit, error))
- func OnFile(call func(*Orbit, []string) (interface{}, string, error))
- func OnInit(call func(*Orbit))
- type Orbit
- func (orb *Orbit) Context() context.Context
- func (orb *Orbit) Def(name string, item interface{})
- func (orb *Orbit) Exec(name string, code interface{}) (err error)
- func (orb *Orbit) File(name string, extn string) (code interface{}, file string, err error)
- func (orb *Orbit) Next(t Task)
- func (orb *Orbit) Pull(t Task)
- func (orb *Orbit) Push(t Task)
- func (orb *Orbit) Quit(err error)
- func (orb *Orbit) WithContext(ctx context.Context) *Orbit
- type Task
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func OnExit ¶
func OnExit(call func(*Orbit))
OnExit registers a callback for when the program shuts down
Types ¶
type Orbit ¶
type Orbit struct { // Underlying Otto instance. *otto.Otto // Emitter *emitr.Emitter // contains filtered or unexported fields }
Orbit is a node.go context.
func (*Orbit) Pull ¶
Pull removes an asynchronous task from the queue, cleaning up any context data. If all asynchronous events are completed, the script will finish.
func (*Orbit) Push ¶
Push pushes an asynchronous task onto the queue, ensuring that the script does not finish before the task is complete.
type Task ¶
type Task interface { // Startup is called when the task is pushed onto the queue. Startup(*Orbit) // Cleanup is called when the task is pulled from the queue. Cleanup(*Orbit) // Execute is called when the task is being called from the run loop. Execute(*Orbit) error }
Task is a job that can be added to the asynchronous queue.
Click to show internal directories.
Click to hide internal directories.