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);
?>PHP - Manual: GearmanClient::addOptions
2025-10-25
(PECL gearman >= 0.6.0)
GearmanClient::addOptions — Add client options
Adds one or more options to those already set.
option
The options to add.
One of the following constants, or a combination of
them using the bitwise OR operator (|
):
GEARMAN_CLIENT_GENERATE_UNIQUE,
GEARMAN_CLIENT_NON_BLOCKING,
GEARMAN_CLIENT_UNBUFFERED_RESULT or
GEARMAN_CLIENT_FREE_TASKS.
Always returns true.
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);
?>官方地址:https://www.php.net/manual/en/gearmanclient.addoptions.php