|
|
@@ -39,10 +39,11 @@ namespace Astralis {
|
|
|
close();
|
|
|
throw new IOError.CLOSED("Cannot send to closed SSE stream");
|
|
|
}
|
|
|
- // Skip writing if the buffer is full (client is slow)
|
|
|
- if (output.write_would_block) {
|
|
|
- return;
|
|
|
- }
|
|
|
+ // Backpressure is applied by AsyncOutput.write, which waits for
|
|
|
+ // the socket buffer to drain. Dropping events here (the old
|
|
|
+ // write_would_block skip) lost backlog events whenever a burst
|
|
|
+ // outran the client — SSE has no retransmit, so every event
|
|
|
+ // must be written.
|
|
|
var formatted = event.format();
|
|
|
yield output.write(new ByteBuffer.from_byte_array(formatted.data));
|
|
|
}
|