PHP 8.6.0 Beta 3 is available for testing

Yar_Concurrent_Client::reset

(PECL yar >= 1.2.4)

Yar_Concurrent_Client::resetClean all registered calls

Beschreibung

public static function Yar_Concurrent_Client::reset(): bool

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

Hinweis:

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.

Parameter-Liste

Diese Funktion besitzt keine Parameter.

Rückgabewerte

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.

Beispiele

Beispiel #1 Yar_Concurrent_Client::reset() example

<?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();
?>

Siehe auch

add a note

User Contributed Notes

There are no user contributed notes for this page.
To Top