public function request(string
$method, string
$url, array
$options =
[]): ResponseInterface
{ $state =
new class() { public ?string
$buffer = null;
public ?string
$lastEventId = null;
public float
$reconnectionTime;
public ?float
$lastError = null;
};
$state->reconnectionTime =
$this->reconnectionTime;
if ($accept = self::
normalizeHeaders($options['headers'
] ??
[])['accept'
] ??
[]) { $state->buffer = \
in_array($accept,
[['Accept: text/event-stream'
],
['accept: text/event-stream'
]], true
) ? '' : null;
if (null !==
$state->buffer
) { $options['extra'
]['trace_content'
] = false;
} } return new AsyncResponse($this->client,
$method,
$url,
$options,
static function DChunkInterface
$chunk, AsyncContext
$context) use ($state,
$method,
$url,
$options) { if (null !==
$state->buffer
) { $context->
setInfo('reconnection_time',
$state->reconnectionTime
);
$isTimeout = false;
}