The Yar_Concurrent_Client class

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

Einführung

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.

Hinweis:

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.

Klassenbeschreibung

class Yar_Concurrent_Client {
/* Methoden */
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
}

Inhaltsverzeichnis

add a note

User Contributed Notes

There are no user contributed notes for this page.