rafa
Version:
Rafa.js is a Javascript framework for building concurrent applications.
21 lines (16 loc) • 568 B
Markdown
Configure the channel. Sometimes it is useful to resize the channel, i.e.
make an unbuffered channel buffered or increase the capacity of the buffer.
This method will throw an error if it is asked to set the capacity to a value
than is less than the current length of the buffer.
<aside>
```js
// configure(capacity: Int, action: String): Channel
var channel = Rafa.channel(); // unbuffered
var values = [];
channel.write(1); // dropped
channel.configure(1); // buffered
channel.write(2); // queued
channel.read(v => values.push(v));
// values: [2];
```
</aside>