# createQueue

```ts
function createQueue<T, TClose>(): Queue<T, TClose>
```

Creates a new queue. Queues are unlimited in size and sending a message to a
queue is always synchronous.

### Examples
#### Example 1
```javascript
import { each, main, createQueue } from 'effection';

await main(function*() {
  let queue = createQueue<number>();
  queue.add(1);
  queue.add(2);
  queue.add(3);

  let next = yield* queue.subscription.next();
  while (!next.done) {
    console.log("got number", next.value);
    next = yield* queue.subscription.next();
  }
});
```

---
### Type Parameters
T
the type of the items in the queue


TClose
the type of the value that the queue is closed with


### Return Type


[Queue](https://frontside.com/effection/api/v4-next/Queue.md)&lt;T, TClose&gt;

[View code](https://github.com/thefrontside/effection/tree/effection-v4.2.0/lib/queue.ts#L56)
