# Queue

```ts
interface Queue<T, TClose> extends Subscription<T, TClose>
```

A FIFO queue which can be used to implement the [Subscription](https://frontside.com/effection/api/v3/Subscription.md)
interface directly. Most of the time, you will use either a [Signal](https://frontside.com/effection/api/v3/Signal.md)
or a [Channel](https://frontside.com/effection/api/v3/Channel.md) as the mechanism, but `Queue` allows you to manage
a single subscription directly.



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


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


### Methods
<dl>
<dt class="border-dotted [&:not(:first-child)]:border-t-2 [&:not(:first-child)]:pt-3 [&:not(:first-child)]:mt-2"><h4 id="add" class="inline scroll-mt-[100px]">add</h4>(**item**: T): void</dt>
<dd class="flex flex-col [&>pre]:mb-3 [&>p:not(:first-child)]:mt-0" >
Add a value to the queue. The oldest value currently in the queue will
be the first to be read.
</dd>
<dt class="border-dotted [&:not(:first-child)]:border-t-2 [&:not(:first-child)]:pt-3 [&:not(:first-child)]:mt-2"><h4 id="close" class="inline scroll-mt-[100px]">close</h4>(**value**: TClose): void</dt>
<dd class="flex flex-col [&>pre]:mb-3 [&>p:not(:first-child)]:mt-0" >
Close the queue.
</dd>
</dl>

[View code](https://github.com/thefrontside/effection/tree/effection-v3.6.1/lib/queue.ts#L13)
