« Yar_Concurrent_Client::loop
Yar_Server_Exception »

Yar_Concurrent_Client::reset

(PECL yar >= 1.2.4)

Yar_Concurrent_Client::reset — Clean all registered calls

説明

public static function Yar_Concurrent_Client::reset(): bool

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

注意:

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.

パラメータ

この関数にはパラメータはありません。

戻り値

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.

例

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

参考

関連キーワード:
Concurrent   Client   registered   reset   call   calls   loop   sent   never   concurrent   example   callback   retval   Server   Exception   static   Discards   empties   list   automatically   once   finished   needed   abort   batch
関連する関数・ページ:
class.yar-concurrent-client   yar-concurrent-client.call   yar-concurrent-client.loop   book.yar   yar.examples   mysql-xdevapi-client.construct