package broadcaster
import "github.com/dotcloud/docker/pkg/broadcaster"
Index ¶
- type Buffered
- func NewBuffered() *Buffered
- func (broadcaster *Buffered) Add(w io.Writer) error
- func (broadcaster *Buffered) Close()
- func (broadcaster *Buffered) CloseWithError(result error)
- func (broadcaster *Buffered) Wait() error
- func (broadcaster *Buffered) Write(p []byte) (n int, err error)
- type Unbuffered
Types ¶
type Buffered ¶
Buffered keeps track of one or more observers watching the progress of an operation. For example, if multiple clients are trying to pull an image, they share a Buffered struct for the download operation.
func NewBuffered ¶
func NewBuffered() *Buffered
NewBuffered returns an initialized Buffered structure.
func (*Buffered) Add ¶
Add adds an observer to the broadcaster. The new observer receives the data from the history buffer, and also all subsequent data.
func (*Buffered) Close ¶
func (broadcaster *Buffered) Close()
Close signals to all observers that the operation has finished. It causes all calls to Wait to return nil.
func (*Buffered) CloseWithError ¶
CloseWithError signals to all observers that the operation has finished. Its argument is a result that should be returned to waiters blocking on Wait.
func (*Buffered) Wait ¶
Wait blocks until the operation is marked as completed by the Close method, and all writer goroutines have completed. It returns the argument that was passed to Close.
func (*Buffered) Write ¶
Write adds data to the history buffer, and also writes it to all current observers.
type Unbuffered ¶
type Unbuffered struct {
// contains filtered or unexported fields
}
Unbuffered accumulates multiple io.WriteCloser by stream.
func (*Unbuffered) Add ¶
func (w *Unbuffered) Add(writer io.WriteCloser)
Add adds new io.WriteCloser.
func (*Unbuffered) Clean ¶
func (w *Unbuffered) Clean() error
Clean closes and removes all writers. Last non-eol-terminated part of data will be saved.
func (*Unbuffered) Write ¶
func (w *Unbuffered) Write(p []byte) (n int, err error)
Write writes bytes to all writers. Failed writers will be evicted during this call.
Source Files ¶
- Version
- v1.9.0-rc3
- Published
- Oct 28, 2015
- Platform
- js/wasm
- Imports
- 3 packages
- Last checked
- 58 seconds ago –
Tools for package owners.