JuliaLang/julia — pull request #8507 by amitmurthy (2014-09-28 16:32:29+00:00)
Title: WIP/RFC: Channel and RemoteChannel

Revisiting the idea to have support for "channels" in Base.

- A `Channel` is used for inter-task communication. Implementation is in `task.jl`
- Channels have a size, i.e., the maximum number of elements that can be `put!` without blocking. Defaults to 1.
- They also have a type associated with it. Defaults to `Any`.
- Channels would be a much cleaner interface for the recent `ClusterManager` interface change, where multiple tasks work in parallel totally asynchronously, unlike the `produce`/`consume` pattern which works best where both the producer and consumer work in lock-step.
- `put!` blocks when a channel is full.
- `take!` and `wait` block when it is empty.
- `isready` denotes availability of data in the channel

- `RemoteRef` has been renamed to `RemoteChannel`. Like local channels, they too have a size and type associated with it. Defaults to 1 and `Any`. Unlike a `Channel`, a `RemoteChannel` is accessible across processes.

TODO:
- [ ] documentation
- [ ] more tests
- [ ] Change the backing object of a `RemoteChannel` to use a `Channel`