SunshinePHP Developer Conference 2015

GearmanClient::addOptions

(PECL gearman >= 0.6.0)

GearmanClient::addOptionsAdd client options

说明

public bool GearmanClient::addOptions ( int $options )

Adds one or more options to those already set.

参数

options

The options to add

返回值

Always returns TRUE.

add a note add a note

User Contributed Notes 2 notes

up
1
flaviohbatista at gmail dot com
1 year ago
The currently supported options are:

GEARMAN_CLIENT_NON_BLOCKING
Run the cient in a non-blocking mode.

GEARMAN_CLIENT_FREE_TASKS
Automatically free task objects once they are complete.

GEARMAN_CLIENT_UNBUFFERED_RESULT
Allow the client to read data in chunks rather than have the library buffer the entire data result and pass that back.

GEARMAN_CLIENT_GENERATE_UNIQUE
Generate a unique id for each task created by generating a UUID.
up
1
goran dot v dot miskovic at gmail dot com
2 years ago
To add multiple options at once use pipe separated list.
<?php
$client
= new GearmanClient();
$client->addOptions(GEARMAN_CLIENT_NON_BLOCKING | GEARMAN_CLIENT_FREE_TASKS | GEARMAN_CLIENT_UNBUFFERED_RESULT);
?>
To Top