Documentation
¶
Overview ¶
Package logring keeps the last lines a child process wrote.
Both the function runner and the Cloud Run runner need it: a child's output is the only account of why it failed, and it has to be bounded or a chatty process grows the emulator without end.
Index ¶
Constants ¶
const DefaultLines = 1000
DefaultLines is how much of a child's output is kept. Enough to explain a crash or read a request trace, small enough that a chatty function cannot grow the emulator without bound.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Ring ¶
type Ring struct {
// contains filtered or unexported fields
}
Ring keeps the last lines a function wrote and fans new ones out to followers. It is the function's stdout and stderr merged, in the order the child produced them.
func (*Ring) Follow ¶
Follow returns a channel of lines written from now on, and a function to stop following. The channel is buffered; a follower that stops reading drops lines rather than blocking the function.