Documentation ¶
Index ¶
Constants ¶
View Source
const ( PRIORITY_LOW = 0 PRIORITY_HIGH = 1 JobPrefix = "H:" CronJobPrefix = "S:" EpochTimePrefix = "UTC-" )
View Source
const ( Network = "tcp" // queue size QueueSize = 8 // read buffer size BufferSize = 4096 // min packet length MinPacketLength = 12 // \x00REQ Req = 5391697 ReqStr = "\x00REQ" // \x00RES Res = 5391699 ResStr = "\x00RES" DefaultTimeout = 20 // 20 Seconds HANDLE_SHAKE_HEADER_LENGTH = 12 )
View Source
const ( // Job type JobNormal = iota // low level JobLow // high level JobHigh )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type CronJob ¶
type CronJob struct { JobTemplete Job `json:"job_templete,omitempty"` Handle string `json:"cronjob_handle,omitempty"` CronEntryID int `json:"cron_entry_id"` Expression string `json:"expression,omitempty"` Next time.Time `json:"next,omitempty"` Prev time.Time `json:"prev,omitempty"` Created int `json:"created,omitempty"` SuccessfulRun int `json:"successful_run,omitempty"` FailedRun int `json:"failed_run,omitempty"` }
type CronSpecInterface ¶
func NewCronSchedule ¶
func NewCronSchedule(expr string) (CronSpecInterface, error)
type Job ¶
type Job struct { Handle string `json:"job_handle,omitempty"` //server job handle Id string `json:"id,omitempty"` Data []byte `json:"data,omitempty"` Running bool `json:"is_running,omitempty"` Percent int `json:"percent,omitempty"` Denominator int `json:"denominator,omitempty"` CreateAt time.Time `json:"created_at,omitempty"` ProcessAt time.Time `json:"process_at,omitempty"` TimeoutSec int32 `json:"timeout_sec,omitempty"` CreateBy int64 `json:"created_by,omitempty"` //client sessionId ProcessBy int64 `json:"process_by,omitempty"` //worker sessionId FuncName string `json:"function_name,omitempty"` IsBackGround bool `json:"is_background_job"` Priority int `json:"priority"` CronHandle string `json:"cronjob_handle,omitempty"` }
type PT ¶
type PT uint32
const ( PT_CanDo PT = iota + 1 // 1 REQ Worker PT_CantDo // REQ Worker PT_ResetAbilities // REQ Worker PT_PreSleep // REQ Worker PT_Noop // RES Worker PT_SubmitJob // REQ Client PT_JobCreated // RES Client PT_GrabJob // REQ Worker PT_NoJob // RES Worker PT_JobAssign // RES Worker PT_WorkStatus // REQ Worker // RES Client PT_WorkComplete // REQ Worker // RES Client PT_WorkFail // REQ Worker // RES Client PT_GetStatus // REQ Client PT_EchoReq // REQ Client/Worker PT_EchoRes // RES Client/Worker PT_SubmitJobBG // REQ Client PT_Error // RES Client/Worker PT_StatusRes // RES Client PT_SubmitJobHigh // REQ Client PT_SetClientId // REQ Worker PT_CanDoTimeout // REQ Worker PT_AllYours // REQ Worker PT_WorkException // REQ Worker // RES Client PT_OptionReq // REQ Client/Worker PT_OptionRes // RES Client/Worker PT_WorkData // REQ Worker // RES Client PT_WorkWarning // REQ Worker // RES Client PT_GrabJobUniq // REQ Worker PT_JobAssignUniq // RES Worker PT_SubmitJobHighBG // REQ Client PT_SubmitJobLow // REQ Client PT_SubmitJobLowBG // REQ Client PT_SubmitJobSched // REQ Client PT_SubmitJobEpoch // 36 REQ Client // New Codes (ref: https://github.com/gearman/gearmand/commit/eabf8a01030a16c80bada1e06c4162f8d129a5e8) PT_SubmitReduceJob // REQ Client PT_SubmitReduceJobBackground // REQ Client PT_GrabJobAll // REQ Worker PT_JobAssignAll // RES Worker PT_GetStatusUnique // REQ Client PT_StatusResUnique // RES Client )
Click to show internal directories.
Click to hide internal directories.