# ee-ttl-queue

> Queue with timeout

Latest version **0.2.0** (published 2015-01-19) · 0 weekly downloads

> **Deprecated.** This package is deprecated.

## Install

```sh
npm install ee-ttl-queue
pnpm add ee-ttl-queue
yarn add ee-ttl-queue
bun add ee-ttl-queue
```

## Health

**Score 10/100 (F)** — status: deprecated.

Negative: deprecated.

## Facts

| | |
|---|---|
| Version | 0.2.0 |
| Published | 2015-01-19 |
| First published | 2013-08-23 |
| Weekly downloads | 0 |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >=v0.10.17 |
| Dependencies | 5 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Michael van der Weg |
| Maintainers | ee |
| Keywords | queue, ttl, timeout |

## Links

- npm: https://www.npmjs.com/package/ee-ttl-queue
- Repository: https://github.com/eventEmitter/ee-ttl-queue
- Issues: https://github.com/eventEmitter/ee-ttl-queue/issues
- npm.io page: https://npm.io/package/ee-ttl-queue

## Dependencies (5)

- [ee-log](https://npm.io/package/ee-log.md) 0.2.x
- [ee-class](https://npm.io/package/ee-class.md) 1.0.x
- [ee-error](https://npm.io/package/ee-error.md) 0.1.x
- [ee-types](https://npm.io/package/ee-types.md) 0.1.x
- [ee-event-emitter](https://npm.io/package/ee-event-emitter.md) 0.2.x

## Alternatives

- [cron](https://npm.io/package/cron.md) — 4.9M weekly downloads
- [@vercel/queue](https://npm.io/package/@vercel/queue.md) — 731.6K weekly downloads
- [create-sonicjs](https://npm.io/package/create-sonicjs.md) — 1.6K weekly downloads
- [@exellix/jobs-api](https://npm.io/package/@exellix/jobs-api.md) — 941 weekly downloads
- [@forwardimpact/libskill](https://npm.io/package/@forwardimpact/libskill.md) — 575 weekly downloads

## Recent versions

- 0.2.0 (latest) — 2015-01-19
- 0.1.4 — 2014-08-25
- 0.1.3 — 2014-04-30
- 0.1.2 — 2013-11-11
- 0.1.1 — 2013-09-06
- 0.1.0 — 2013-08-23

## README

# ee-ttl-queue

Queue with timeout function

## installation

	npm install ee-ttl-queue


## build status

[![Build Status](https://travis-ci.org/eventEmitter/ee-ttl-queue.png?branch=master)](https://travis-ci.org/eventEmitter/ee-ttl-queue)

## usage

	var Queue = require( "ee-ttl-queue" )
		. log = require( "ee-log" );


	// create a queue wich cannot hold more than 9 items at the time
	// the items added to the queue will timeout if they are not 
	// retreived via the .get() api.
	// the timeout event will emit the items which are timed out.
	// the error event will be invoked if the queue is overflowing, 
	// which is in this case when the 10th item is added.

	var q = new Queue( { 
		  ttl: 1000
		, max: 9 
		, on: {
			timeout: function( item ){ log( item ); }
			, error: function( err, item ){ log( err ); }
		}
	} );


	// you may queue any type of variable, return true when the item was queued
	var itemWasAdded = q.queue( whatever );

	// alternative syntax
	var itemWasAdded = q.add( whatever );

	// you may remove items again
	q.remove( whatever );

	// retreive the oldest item
	var item = q.get();

---
_Source: https://npm.io/package/ee-ttl-queue · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
