Öntanımlı Sabitler

Buradaki sabitler bu eklenti için tanımlanmış olup, sadece eklentinin PHP içinde derlenmiş olması veya çalışma anında dinamik olarak yüklenmesi halinde kullanılabilir.

Return values. Always check GearmanClient::error() or GearmanWorker() for a string error, as it may contain more details:

GEARMAN_SUCCESS (int)
Whatever action was taken was successful.
GEARMAN_IO_WAIT (int)
When in non-blocking mode, an event is hit that would have blocked.
GEARMAN_ERRNO (int)
A system error. Check GearmanClient::errno() or GearmanWorker::errno() for the system error code that was returned.
GEARMAN_NO_ACTIVE_FDS (int)
GearmanClient::wait() or GearmanWorker() was called with no connections.
GEARMAN_UNEXPECTED_PACKET (int)
Indicates something going very wrong in gearmand. Applies only to GearmanWorker.
GEARMAN_GETADDRINFO (int)
DNS resolution failed (invalid host, port, etc).
GEARMAN_NO_SERVERS (int)
Did not call GearmanClient::addServer() before submitting jobs or tasks.
GEARMAN_LOST_CONNECTION (int)
Lost a connection during a request.
GEARMAN_MEMORY_ALLOCATION_FAILURE (int)
Memory allocation failed (ran out of memory).
GEARMAN_SERVER_ERROR (int)
Something went wrong in the Gearman server and it could not handle the request gracefully.
GEARMAN_WORK_DATA (int)
Notice return code obtained with GearmanClient::returnCode() when using GearmanClient::do(). Sent to update the client with data from a running job. A worker uses this when it needs to send updates, send partial results, or flush data during long running jobs.
GEARMAN_WORK_WARNING (int)
Notice return code obtained with GearmanClient::returnCode() when using GearmanClient::do(). Updates the client with a warning. The behavior is just like GEARMAN_WORK_DATA, but should be treated as a warning instead of normal response data.
GEARMAN_WORK_STATUS (int)
Notice return code obtained with GearmanClient::returnCode() when using GearmanClient::do(). Sent to update the status of a long running job. Use GearmanClient::doStatus() to obtain the percentage complete of the task.
GEARMAN_WORK_EXCEPTION (int)
Notice return code obtained with GearmanClient::returnCode() when using GearmanClient::do(). Indicates that a job failed with a given exception.
GEARMAN_WORK_FAIL (int)
Notice return code obtained with GearmanClient::returnCode() when using GearmanClient::do(). Indicates that the job failed.
GEARMAN_COULD_NOT_CONNECT (int)
Failed to connect to servers.
GEARMAN_INVALID_FUNCTION_NAME (int)
Trying to register a function name of NULL or using the callback interface without specifying callbacks.
GEARMAN_INVALID_WORKER_FUNCTION (int)
Trying to register a function with a NULL callback function.
GEARMAN_NO_REGISTERED_FUNCTIONS (int)
When a worker gets a job for a function it did not register.
GEARMAN_NO_JOBS (int)
For a non-blocking worker, when GearmanWorker::work() does not have any active jobs.
GEARMAN_ECHO_DATA_CORRUPTION (int)
After GearmanClient::echo() or GearmanWorker::echo() the data returned doesn't match the data sent.
GEARMAN_NEED_WORKLOAD_FN (int)
When the client opted to stream the workload of a task, but did not specify a workload callback function.
GEARMAN_PAUSE (int)
For the non-blocking client task interface, can be returned from the task callback to "pause" the call and return from GearmanClient::runTasks(). Call GearmanClient::runTasks() again to continue.
GEARMAN_UNKNOWN_STATE (int)
Internal client/worker state error.
GEARMAN_SEND_BUFFER_TOO_SMALL (int)
Internal error: trying to flush more data in one atomic chunk than is possible due to hard-coded buffer sizes.
GEARMAN_TIMEOUT (int)
Hit the timeout limit set by the client/worker.

GearmanClient options:

GEARMAN_CLIENT_GENERATE_UNIQUE (int)
Generate a unique id (UUID) for each task.
GEARMAN_CLIENT_NON_BLOCKING (int)
Run the cient in a non-blocking mode.
GEARMAN_CLIENT_UNBUFFERED_RESULT (int)
Allow the client to read data in chunks rather than have the library buffer the entire data result and pass that back.
GEARMAN_CLIENT_FREE_TASKS (int)
Automatically free task objects once they are complete. This is the default setting in this extension to prevent memory leaks.

GearmanWorker options:

GEARMAN_WORKER_NON_BLOCKING (int)
Run the worker in non-blocking mode.
GEARMAN_WORKER_GRAB_UNIQ (int)
Return the client assigned unique ID in addition to the job handle.

Base Gearman configuration:

GEARMAN_DEFAULT_TCP_HOST (string)
GEARMAN_DEFAULT_TCP_PORT (int)
GEARMAN_DEFAULT_SOCKET_TIMEOUT (int)
GEARMAN_DEFAULT_SOCKET_SEND_SIZE (int)
GEARMAN_DEFAULT_SOCKET_RECV_SIZE (int)
GEARMAN_MAX_ERROR_SIZE (int)
GEARMAN_PACKET_HEADER_SIZE (int)
GEARMAN_JOB_HANDLE_SIZE (int)
GEARMAN_OPTION_SIZE (int)
GEARMAN_UNIQUE_SIZE (int)
GEARMAN_MAX_COMMAND_ARGS (int)
GEARMAN_ARGS_BUFFER_SIZE (int)
GEARMAN_SEND_BUFFER_SIZE (int)
GEARMAN_RECV_BUFFER_SIZE (int)
GEARMAN_WORKER_WAIT_TIMEOUT (int)

add a note

User Contributed Notes 5 notes

up
6
ion dot dulgheru at gmail dot com
12 years ago
an update (gearman 0.35):GEARMAN_NO_REGISTERED_FUNCTION = 33GEARMAN_NO_REGISTERED_FUNCTIONS =    34GEARMAN_NO_JOBS = 35GEARMAN_ECHO_DATA_CORRUPTION = 36GEARMAN_NEED_WORKLOAD_FN = 37GEARMAN_PAUSE = 38GEARMAN_UNKNOWN_STATE = 39GEARMAN_PTHREAD = 40GEARMAN_PIPE_EOF     = 41GEARMAN_QUEUE_ERROR    = 42GEARMAN_FLUSH_DATA = 43GEARMAN_SEND_BUFFER_TOO_SMALL = 44GEARMAN_IGNORE_PACKET = 45GEARMAN_UNKNOWN_OPTION = 46GEARMAN_TIMEOUT    = 47GEARMAN_ARGUMENT_TOO_LARGE = 48GEARMAN_MAX_RETURN =    49
up
4
Shane Harter
15 years ago
I looked everywhere for for a dump of the values of each of the gearman constants. I ended up in the gearman source. You'll find this useful if you ever just echo the return code. GEARMAN_SUCCESS = 0GEARMAN_IO_WAIT = 1GEARMAN_SHUTDOWN = 2GEARMAN_SHUTDOWN_GRACEFUL = 3GEARMAN_ERRNO = 4GEARMAN_EVENT = 5GEARMAN_TOO_MANY_ARGS = 6GEARMAN_NO_ACTIVE_FDS = 7GEARMAN_INVALID_MAGIC = 8GEARMAN_INVALID_COMMAND = 9GEARMAN_INVALID_PACKET = 10GEARMAN_UNEXPECTED_PACKET = 11GEARMAN_GETADDRINFO = 12GEARMAN_NO_SERVERS = 13GEARMAN_LOST_CONNECTION = 14GEARMAN_MEMORY_ALLOCATION_FAILURE = 15GEARMAN_JOB_EXISTS = 16GEARMAN_JOB_QUEUE_FULL = 17GEARMAN_SERVER_ERROR = 18GEARMAN_WORK_ERROR = 19GEARMAN_WORK_DATA = 20GEARMAN_WORK_WARNING = 21GEARMAN_WORK_STATUS = 22GEARMAN_WORK_EXCEPTION = 23GEARMAN_WORK_FAIL = 24GEARMAN_NOT_CONNECTED = 25GEARMAN_COULD_NOT_CONNECT = 26GEARMAN_SEND_IN_PROGRESS = 27GEARMAN_RECV_IN_PROGRESS = 28GEARMAN_NOT_FLUSHING = 29GEARMAN_DATA_TOO_LARGE = 30GEARMAN_INVALID_FUNCTION_NAME = 31GEARMAN_INVALID_WORKER_FUNCTION = 32GEARMAN_NO_REGISTERED_FUNCTIONS = 33GEARMAN_NO_JOBS = 34GEARMAN_ECHO_DATA_CORRUPTION = 35GEARMAN_NEED_WORKLOAD_FN = 36GEARMAN_PAUSE = 37GEARMAN_UNKNOWN_STATE = 38GEARMAN_PTHREAD = 39GEARMAN_PIPE_EOF = 40GEARMAN_QUEUE_ERROR = 41GEARMAN_FLUSH_DATA = 42GEARMAN_SEND_BUFFER_TOO_SMALL = 43GEARMAN_IGNORE_PACKET = 44GEARMAN_UNKNOWN_OPTION = 45GEARMAN_MAX_RETURN = 46
up
1
michaelhfranze at gmail dot com
10 years ago
If you are gettingError 26  GEARMAN_COULD_NOT_CONNECT (integer)and you are running SELinux then you need to setsetsetbool -P http_can_network_connect = 1
up
1
y_inaura at hm-solution dot jp
10 years ago
retrunCodes is missed from No.33 .I think , Correct retrunCodes are this.GEARMAN_SUCCESS = 0GEARMAN_IO_WAIT = 1GEARMAN_SHUTDOWN = 2GEARMAN_SHUTDOWN_GRACEFUL = 3GEARMAN_ERRNO = 4GEARMAN_EVENT = 5GEARMAN_TOO_MANY_ARGS = 6GEARMAN_NO_ACTIVE_FDS = 7GEARMAN_INVALID_MAGIC = 8GEARMAN_INVALID_COMMAND = 9GEARMAN_INVALID_PACKET = 10GEARMAN_UNEXPECTED_PACKET = 11GEARMAN_GETADDRINFO = 12GEARMAN_NO_SERVERS = 13GEARMAN_LOST_CONNECTION = 14GEARMAN_MEMORY_ALLOCATION_FAILURE = 15GEARMAN_JOB_EXISTS = 16GEARMAN_JOB_QUEUE_FULL = 17GEARMAN_SERVER_ERROR = 18GEARMAN_WORK_ERROR = 19GEARMAN_WORK_DATA = 20GEARMAN_WORK_WARNING = 21GEARMAN_WORK_STATUS = 22GEARMAN_WORK_EXCEPTION = 23GEARMAN_WORK_FAIL = 24GEARMAN_NOT_CONNECTED = 25GEARMAN_COULD_NOT_CONNECT = 26GEARMAN_SEND_IN_PROGRESS = 27GEARMAN_RECV_IN_PROGRESS = 28GEARMAN_NOT_FLUSHING = 29GEARMAN_DATA_TOO_LARGE = 30GEARMAN_INVALID_FUNCTION_NAME = 31GEARMAN_INVALID_WORKER_FUNCTION = 32GEARMAN_NO_REGISTERED_FUNCTIONS = 34GEARMAN_NO_JOBS = 35GEARMAN_ECHO_DATA_CORRUPTION = 36GEARMAN_NEED_WORKLOAD_FN = 37GEARMAN_PAUSE = 38GEARMAN_UNKNOWN_STATE = 39GEARMAN_PTHREAD = 40GEARMAN_PIPE_EOF = 41GEARMAN_QUEUE_ERROR = 42GEARMAN_FLUSH_DATA = 43GEARMAN_SEND_BUFFER_TOO_SMALL = 44GEARMAN_IGNORE_PACKET = 45GEARMAN_UNKNOWN_OPTION = 46GEARMAN_MAX_RETURN = 52
up
0
Anonymous
3 years ago
There is an GEARMAN_WORKER_GRAB_JOB_IN_USE constant that allows you to retry a job that has been exited by same or another worker (exited unsuccessfully width code <> 0)
To Top