> For the complete documentation index, see [llms.txt](https://roman-sarder.gitbook.io/csp-coffee/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://roman-sarder.gitbook.io/csp-coffee/packages-and-api/channels/makechannel.md).

# makeChannel

function makeChannel\<T = any>(bufferType?: CreatableBufferType, capacity?: number, id?: string): Channel\<T>

```javascript
import { makeChannel } from 'csp-coffee/channel' 
```

{% hint style="warning" %}
Default buffer type is **Fixed** and default capacity is 1.
{% endhint %}

The first argument is the [buffer type](/csp-coffee/packages-and-api/buffers.md). The second argument is capacity of our channel i.e how many values it can hold before buffer logic comes into play. The last argument is id and by default this will be a uuid v4 string, but you can specify a custom id for debugging purposes.

## Channel

### id: string

This is either an auto generated uuid string or id passed to makeChannel function

### isClosed: boolean

The name is self-explanatory. This flag indicates whether the channel is closed or not. Closed channel does not contain any values and cannot be supplied with new ones.

### isBuffered: boolean

Indicates whether the channel will block the operations which want to insert a new value into it. Is a proxy for underlying buffer's `isBlocked` property.

### capacity: number

Maximum number of items the channel can hold before internal buffer behavior comes into play.

### is: (ch: Channel) => boolean;

Is method used to compare two channels for equality based on their ids.

### Symbol.asyncIterator()

Every channel in this library is [async iterable](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Symbol/asyncIterator)
