Documentation ¶
Index ¶
- func AddJob(taskName string, maxRetry int, args []byte) (err error)
- func NewTaskQueueWorker(service factory.ServiceFactory, q QueueStorage, db *mongo.Database, ...) factory.AppServerFactory
- type Filter
- type Job
- type JobListResolver
- type MetaJobList
- type MetaTaskResolver
- type OptionFunc
- type QueueStorage
- type TaglineResolver
- type TaskListResolver
- type TaskResolver
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewTaskQueueWorker ¶ added in v1.6.8
func NewTaskQueueWorker(service factory.ServiceFactory, q QueueStorage, db *mongo.Database, opts ...OptionFunc) factory.AppServerFactory
NewTaskQueueWorker create new task queue worker
Types ¶
type Job ¶
type Job struct { ID string `bson:"_id" json:"_id"` TaskName string `bson:"task_name" json:"task_name"` Arguments string `bson:"arguments" json:"arguments"` Retries int `bson:"retries" json:"retries"` MaxRetry int `bson:"max_retry" json:"max_retry"` Interval string `bson:"interval" json:"interval"` CreatedAt time.Time `bson:"created_at" json:"created_at"` FinishedAt time.Time `bson:"finished_at" json:"finished_at"` Status string `bson:"status" json:"status"` Error string `bson:"error" json:"error"` TraceID string `bson:"traceId" json:"traceId"` NextRetryAt string `bson:"-" json:"-"` }
Job model
type JobListResolver ¶
type JobListResolver struct { Meta MetaJobList Data []Job }
JobListResolver resolver
type MetaJobList ¶ added in v1.6.8
type MetaJobList struct { Page int Limit int TotalRecords int TotalPages int IsCloseSession bool Detail struct { GiveUp, Retrying, Success, Queueing, Stopped int } }
MetaJobList resolver
type MetaTaskResolver ¶ added in v1.6.8
type MetaTaskResolver struct { Page int Limit int TotalRecords int TotalPages int IsCloseSession bool }
MetaTaskResolver meta resolver
type OptionFunc ¶ added in v1.6.8
type OptionFunc func(*option)
OptionFunc type
func SetAutoRemoveClientInterval ¶ added in v1.6.8
func SetAutoRemoveClientInterval(d time.Duration) OptionFunc
SetAutoRemoveClientInterval option func
func SetJaegerTracingDashboard ¶ added in v1.6.8
func SetJaegerTracingDashboard(host string) OptionFunc
SetJaegerTracingDashboard option func
func SetMaxClientSubscriber ¶ added in v1.6.8
func SetMaxClientSubscriber(max int) OptionFunc
SetMaxClientSubscriber option func
type QueueStorage ¶
type QueueStorage interface { GetAllJobs(taskName string) []*Job PushJob(job *Job) PopJob(taskName string) Job NextJob(taskName string) *Job Clear(taskName string) }
QueueStorage abstraction for queue storage backend
func NewRedisQueue ¶
func NewRedisQueue(redisPool *redis.Pool) QueueStorage
NewRedisQueue init inmem queue
type TaglineResolver ¶
type TaglineResolver struct { Tagline string TaskListClientSubscribers []string JobListClientSubscribers []string }
TaglineResolver resolver
type TaskListResolver ¶ added in v1.6.8
type TaskListResolver struct { Meta MetaTaskResolver Data []TaskResolver }
TaskListResolver resolver
type TaskResolver ¶
type TaskResolver struct { Name string TotalJobs int Detail struct { GiveUp, Retrying, Success, Queueing, Stopped int } }
TaskResolver resolver
Click to show internal directories.
Click to hide internal directories.