« Yar_Client::setOpt
Yar_Concurrent_Client::call »

The Yar_Concurrent_Client class

(No version information available, might only be in Git)

はじめに

A static helper that batches remote RPC calls. Calls registered with Yar_Concurrent_Client::call() are not sent immediately; they are all dispatched together, in parallel, by Yar_Concurrent_Client::loop().

The class is meant for applications that need the results of several remote calls. Only independent calls — ones that do not need each other's results — can be batched this way; when one call depends on the result of another, the two have to run sequentially. Through Yar_Client the calls are sent one after another, each paying its full round-trip time; with the concurrent client they are sent at the same time, so the overall waiting time drops to the duration of the single slowest call.

注意:

Only HTTP(S) services are supported for concurrent calls. They are sent concurrently through curl's multi-handle interface, which the TCP/Unix socket transport does not implement.

クラス概要

class Yar_Concurrent_Client {
/* メソッド */
public static function call(
    string $uri,
    string $method,
    ?array $parameters = null,
    ?callable $callback = null,
    ?callable $error_callback = null,
    ?array $options = null
): int|false|null
public static function loop(?callable $callback = null, ?callable $error_callback = null, ?array $options = null): ?bool
public static function reset(): bool
}

目次

関連キーワード:
Client   Concurrent   call   calls   static   sent   callable   callback   registered   loop   time   concurrent   remote   they   need   results   options   reset   setOpt   information   available   helper   batches   Calls   immediately
関連する関数・ページ:
yar-concurrent-client.reset   yar-concurrent-client.call   yar-concurrent-client.loop   yar.examples   book.yar   class.yar-client