Documentation
¶
Overview ¶
Package batch coalesces what a run writes for a host to which each write is costly, such as a debug adapter sending an event per write or a page posted a message per write. The language writes each print at once (stdlib.md, File); batching is the host's choice.
Index ¶
Constants ¶
const Size = 4096
Size is how many bytes a batch holds before it is sent without waiting for the delay.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Writer ¶
type Writer struct {
// contains filtered or unexported fields
}
Writer collects writes to several streams and sends them in batches, in the order written: a write to another stream sends what the first one holds first. A batch is sent once it holds Size bytes, delay after its first write, and at Flush. A write also sends a batch whose delay has passed, since on js/wasm no timer fires while the program computes without waiting.