From bbb01ee1ab00455718b32f153c63630de2733f35 Mon Sep 17 00:00:00 2001 From: Michael Crosby Date: Fri, 6 Oct 2017 16:39:38 -0400 Subject: [PATCH] Add docs around multiple attach Signed-off-by: Michael Crosby --- container.go | 3 +++ io.go | 4 ++++ 2 files changed, 7 insertions(+) diff --git a/container.go b/container.go index e8b0b40ec..a9750eca0 100644 --- a/container.go +++ b/container.go @@ -32,6 +32,9 @@ type Container interface { // // If IOAttach options are passed the client will reattach to the IO for the running // task. If no task exists for the container a NotFound error is returned + // + // Clients must make sure that only one reader is attached to the task and consuming + // the output from the task's fifos Task(context.Context, IOAttach) (Task, error) // Image returns the image that the container is based on Image(context.Context) (Image, error) diff --git a/io.go b/io.go index 108af6bb2..48c06f12e 100644 --- a/io.go +++ b/io.go @@ -68,6 +68,10 @@ func (c *cio) Close() error { type IOCreation func(id string) (IO, error) // IOAttach allows callers to reattach to running tasks +// +// There should only be one reader for a task's IO set +// because fifo's can only be read from one reader or the output +// will be sent only to the first reads type IOAttach func(*FIFOSet) (IO, error) // NewIO returns an IOCreation that will provide IO sets without a terminal