Documentation ¶
Overview ¶
Package fifo implements FIFO utilities for skylab_swarming_worker.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Copier ¶
type Copier struct {
// contains filtered or unexported fields
}
Copier encapsulates the operation of copying from a FIFO.
func NewCopier ¶
NewCopier creates a FIFO whose data is copied to the Writer. The copying is done in a goroutine. The returned Copier must be closed to flush and terminate the copying. This function does not block on opening the FIFO for reading.
func (*Copier) Close ¶
Close closes the FIFO and waits for copying to finish. Repeated calls do nothing.
This closes the write fd for the FIFO that we hold and waits for the copying goroutine to read EOF. The FIFO yields EOF only when all writers have been closed. Thus, this will block on any writers that are still holding fds.