Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ErrorJobPanic ¶
type ErrorJobPanic struct {
Message string
}
ErrorJobPanic Error returned when a Job panics
func (ErrorJobPanic) Error ¶
func (e ErrorJobPanic) Error() string
func (ErrorJobPanic) Unwrap ¶
func (e ErrorJobPanic) Unwrap() error
type ErrorJobStarted ¶
type ErrorJobStarted struct {
Message string
}
ErrorJobStarted Error returned when a has already started.
func (ErrorJobStarted) Error ¶
func (e ErrorJobStarted) Error() string
func (ErrorJobStarted) Unwrap ¶
func (e ErrorJobStarted) Unwrap() error
type Job ¶
type Job struct {
// contains filtered or unexported fields
}
Job Wraps JobFun and provide:
- Creation, Start, and Finish Time
- Recover From Panics
func NewJob ¶
func NewJob(jobFunc func()) *Job
NewJob Create new Job, id is assigned a UUID instead.
func NewJobWithID ¶
NewJobWithID Create new Job with the supplied Id.
func (*Job) ActualElapsed ¶
ActualElapsed Return the actual time of procession of Job. Return -1 if job hasn't started yet.
func (*Job) TotalElapsed ¶
TotalElapsed Returns the total time between creation of object and finishing processing its job. Return -1 if job hasn't started yet.
Click to show internal directories.
Click to hide internal directories.