Вход на сайт

Просмотр новости

Найдите то, что Вас интересует

thesis/grpc-deadline

Дата публикации: 03-08-2026 18:11:27

Client-side deadline interceptor (grpc-timeout + local cancellation) for thesis/grpc.

Основное содержимое страницы с новостью.

README

Client-side deadline interceptor for thesis/grpc. It gives every outgoing call a deadline and applies it in two places so the client and server agree on it:

  • the grpc-timeout header, which the server enforces (cancelling the RPC and returning DEADLINE_EXCEEDED);
  • a local TimeoutCancellation, so the client gives up on its own even if the server never responds (a plain client deadline otherwise never reaches the server — the transport does not set grpc-timeout by itself).
Contents Installation
composer require thesis/grpc-deadline
Usage

Register the interceptor on the client's unary and stream chains. A default deadline covers every call:

use Thesis\Grpc\Client;
use Thesis\Grpc\Deadline;
use Thesis\Grpc\Metadata\Timeout;

$deadline = new Deadline\ClientInterceptor(Timeout::seconds(30));

$client = new Client\Builder()
    ->withUnaryInterceptors($deadline)
    ->withStreamInterceptors($deadline)
    ->build();

Override it per call by attaching a Timeout to the call's metadata — the call's own deadline wins over the default:

use Thesis\Grpc\Metadata;
use Thesis\Grpc\Metadata\Timeout;

$client->invoke($request, $invoke, new Metadata()->withKey(Timeout::milliseconds(200)));

Constructed with no default (new Deadline\ClientInterceptor()), the interceptor only acts on calls that carry their own grpc-timeout, and leaves the rest untouched.

Схожие новости

#Наименование новостиТональностьИнформативностьДата публикации
1thesis/grpc-retry027.3803-08-2026
2thesis/grpc-auth017.7803-08-2026
3thesis/grpc-logging03503-08-2026
4lumnd/platophp017.6903-08-2026
5picodev 0.1.40510-07-2026
6tensor-grep 1.58.00510-07-2026
7baponi 0.5.10510-07-2026
83.1.1110511-06-2026
93.1.1010526-05-2026
10automattic/blocks-engine-php-transformer017.1403-08-2026

Классификация: Пресс-релизы. Схожих патентов: 0. Схожих новостей: 10. Тональность: 0. Информативность: 43.33. Источник: packagist.org.