BroadcastBatcher
class BroadcastBatcher
Own the sender while generation and its database transactions stay in the caller.
Properties
| protected StreamEvent, int}> | $channel | ||
| protected WaitConcurrent | $concurrent | ||
| protected Throwable|null | $failure |
Methods
Start one sender in the operation's captured context.
Drain accepted events and wait for the sender to finish.
Cancel the owned sender without draining after parent cancellation.
Read an available event or wait until the current batch's deadline.
Match the invocation and content block of adjacent deltas.
Details
at line 40
__construct(Closure $send, Closure|null $runner, int $milliseconds, int $maxBytes)
Start one sender in the operation's captured context.
at line 70
void
push(StreamEvent $event)
Queue an original event without allowing an unbounded backlog.
at line 95
void
finish()
Drain accepted events and wait for the sender to finish.
at line 122
void
cancel()
Cancel the owned sender without draining after parent cancellation.
at line 133
protected void
drain(Closure $send)
Send compatible queued text without extending the first arrival's deadline.
at line 182
protected array|false
read(int|null $deadline = null)
Read an available event or wait until the current batch's deadline.
at line 218
protected bool
isBatchable(StreamEvent $event)
Identify plain deltas without additional event semantics.
at line 227
protected bool
isCompatible(TextDelta|ReasoningDelta $first, TextDelta|ReasoningDelta $event)
Match the invocation and content block of adjacent deltas.