rafa
Version:
Rafa.js is a Javascript framework for building concurrent applications.
21 lines (16 loc) • 431 B
Markdown
Write a value to the channel. The returned integer value is 1 if the value
was forwarded to the reader, 2 if it was queued, 3 if queued after rotating,
and 0 if it was dropped.
<aside>
```js
// write(value: A): Int
var channel = Rafa.channel();
var values = [];
var results = [];
channel.read(v => values.push(v));
results.push(channel.write(1));
results.push(channel.write(2));
// values: [1];
// results: [1,0];
```
</aside>