Documentation ¶
Index ¶
Constants ¶
View Source
const ( // Job type // JOB_NORMAL | JOB_BG means a normal level job run in background // normal level JOB_NORMAL = 0 // background job JOB_BG = 1 // low level JOB_LOW = 2 // high level JOB_HIGH = 4 )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct { ErrHandler common.ErrorHandler JobHandler JobHandler StatusHandler StatusHandler TimeOut time.Duration // contains filtered or unexported fields }
The client side api for gearman
usage: c := client.New("tcp4", "127.0.0.1:4730") handle := c.Do("foobar", []byte("data here"), JOB_LOW | JOB_BG)
func New ¶
Create a new client. Connect to "addr" through "network" Eg.
client, err := client.New("127.0.0.1:4730")
func (*Client) Do ¶
Do the function. funcname is a string with function name. data is encoding to byte array. flag set the job type, include running level: JOB_LOW, JOB_NORMAL, JOB_HIGH, and if it is background job: JOB_BG. JOB_LOW | JOB_BG means the job is running with low level in background.
Click to show internal directories.
Click to hide internal directories.