php8.5
Home/ Manual/ yar / yar_concurrent_client/ Yar_Concurrent_Client::reset

Yar_Concurrent_Client::reset

PHP function Edit on GitHub ✎

(PECL yar >= 1.2.4)

Clean all registered calls

Description

Yar_Concurrent_Client::reset(): bool

Discards all calls registered with Yar_Concurrent_Client::call that have not been sent yet.

Note

Yar_Concurrent_Client::loop empties the call list automatically once it has finished, so reset is only needed to abort a batch that was never sent.

Parameters Parameters

Return Values

Returns true, or false when the concurrent client is currently inside Yar_Concurrent_Client::loop, in which case an E_WARNING-level error is raised.

Examples

Yar_Concurrent_Client::reset() example

php
<?php
function callback($retval, $callinfo) {
    var_dump($retval);
}

Yar_Concurrent_Client::call("http://api.example.com/operator.php", "some_method", array("parameters"), "callback");

/* never sent: throw the registered call away */
Yar_Concurrent_Client::reset();
?>

See Also

  • Yar_Concurrent_Client::call
  • Yar_Concurrent_Client::loop

Source: reference/yar/yar_concurrent_client/reset.xml · from the official PHP manual (php/doc-en)