Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateCronJobKey ¶ added in v1.9.0
CreateCronJobKey helper
Allowed interval:
* cron expression, example: * * * * *
* standard time duration string, example: 2s, 10m
* custom start time and repeat duration, example:
- 23:00@daily, will repeated at 23:00 every day
- 23:00@weekly, will repeated at 23:00 every week
- 23:00@10s, will repeated at 23:00 and next repeat every 10 seconds
func NewWorker ¶
func NewWorker(service factory.ServiceFactory, opts ...OptionFunc) factory.AppServerFactory
NewWorker create new cron worker
func ParseCronJobKey ¶ added in v1.9.0
ParseCronJobKey helper
Types ¶
type CronJobKey ¶ added in v1.9.0
type CronJobKey struct { JobName string `json:"jobName"` Args string `json:"args"` Interval string `json:"interval"` }
CronJobKey model
func (CronJobKey) String ¶ added in v1.9.0
func (c CronJobKey) String() string
String implement stringer
type Job ¶
type Job struct { HandlerName string `json:"handler_name"` Interval string `json:"interval"` Handler types.WorkerHandler `json:"-"` Params string `json:"params"` WorkerIndex int `json:"worker_index"` // contains filtered or unexported fields }
Job model
type OptionFunc ¶ added in v1.7.4
type OptionFunc func(*option)
OptionFunc type
func SetDebugMode ¶ added in v1.7.4
func SetDebugMode(debugMode bool) OptionFunc
SetDebugMode option func
func SetLocker ¶ added in v1.8.8
func SetLocker(locker candiutils.Locker) OptionFunc
SetLocker option func
func SetMaxGoroutines ¶ added in v1.7.4
func SetMaxGoroutines(maxGoroutines int) OptionFunc
SetMaxGoroutines option func
Click to show internal directories.
Click to hide internal directories.