Commit Graph

12 Commits

Author SHA1 Message Date
Solomon Hykes b9c316df29 inmem: complete Copy implementation
Copy can now handle arbitrary nesting of streams, without knowing the
underlying type of either the source or destination.

It does this by attempting `SendTo` and `ReceiveFrom`, then if that is
not supported, falling back to nested copies in separate goroutines.

Signed-off-by: Solomon Hykes <solomon@docker.com>
2014-05-16 18:48:13 -07:00
Solomon Hykes 1508c1d46f inmem: PipeSender and PipeReceiver return clean nil values
This is necessary because `(*PipeSender)nil` is not equal to
`(interface{})nil`.

Signed-off-by: Solomon Hykes <solomon@docker.com>
2014-05-16 18:48:13 -07:00
Solomon Hykes 048bed0cd1 inmem: a message is simply 1 opcode + an array of binary strings.
Remove redundant `Data` field. Every argument can be arbitrary data.

Signed-off-by: Solomon Hykes <solomon@docker.com>
2014-05-16 18:48:13 -07:00
Solomon Hykes 7d0ba6e26b inmem: Sender implements Close
Signed-off-by: Solomon Hykes <solomon@docker.com>
2014-05-16 18:46:24 -07:00
Solomon Hykes 6616f08fe0 inmem: gofmt
Signed-off-by: Solomon Hykes <solomon@docker.com>
2014-05-16 18:46:23 -07:00
Solomon Hykes f22b8f52f3 inmem: Receiver and Sender don't need to implement Close
Signed-off-by: Solomon Hykes <solomon@docker.com>
2014-05-16 18:46:23 -07:00
Solomon Hykes 91133d63be inmem: Fix PipeSender to implement ReceiverFrom
Signed-off-by: Solomon Hykes <solomon@docker.com>
2014-05-16 18:46:23 -07:00
Solomon Hykes 0feebd2320 inmem: Implement `Copy`, `ReceiveFrom` and `SendTo`
* Copy is the beam equivalent of `io.Copy`
* `ReceiveFrom` is the beam equivalent of `io.ReadFrom`
* `SendTo` is the beam equivalent of `io.WriteTo`

Signed-off-by: Solomon Hykes <solomon@docker.com>
2014-05-16 18:44:23 -07:00
Solomon Hykes 338a7d50a8 inmem: fix nested in/out channels in each message
Signed-off-by: Solomon Hykes <solomon@docker.com>
2014-05-16 18:41:38 -07:00
Solomon Hykes a1ed1ec1fa inmem: switch to a Sender/Receiver/Pipe interface similar to io.Pipe
Signed-off-by: Solomon Hykes <solomon@docker.com>
2014-05-16 18:40:31 -07:00
Solomon Hykes c0364720db beam: no target field yet 2014-05-09 21:00:46 -07:00
Solomon Hykes 3725628467 Beam in-mem: an in-memory implementation of Beam 2014-05-09 21:00:46 -07:00