<commit_before># relyq [![Build Status][1]][2]

A Redis-backed reliable task queue and state machine.

All queuing logic is done using ids. Its made up of four [simpleq](https://github.com/yanatan16/simpleq)'s: todo, doing, failed, and done. Tasks will never be dropped on the floor even if a processing server crashes because all operations are atomic.

## Operation

Install:

```
npm install relyq
```

Creation:

```javascript
var redis = require('redis'),
  cli = redis.createClient();

var relyq = require('relyq'),
  q = new relyq.Q(cli, 'my-relyq');
```

Operations:

- `push(rq, id): simpleq.push(rq.todo, id)`
- `process(rq): simpleq.poppipe(rq.todo, rq.doing)` Pull off a task to be processed
- `finish(rq, id): simpleq.pullpipe(rq.doing, rq.done, id)`
- `fail(rq, id): simpleq.pullpipe(rq.doing, rq.failed, id)`
- `expire(rq, expiry)` Find all expired `doing` tasks and fail them.

## Tests

```
npm install -g nodeunit
npm install --dev
npm test
```

## License

See LICENSE file.

[1]: https://travis-ci.org/yanatan16/node-relyq.png?branch=master
[2]: http://travis-ci.org/yanatan16/node-relyq<commit_msg>Update documentation<commit_after># relyq [![Build Status][1]][2]

A realtively simple Redis-backed reliable task queue and state machine.

Its made up of four [simpleq](https://github.com/yanatan16/simpleq)'s: todo, doing, failed, and done. Tasks will never be dropped on the floor even if a processing server crashes because all operations are atomic. Tasks can be represented as any data type.

## Operation

Install:

```
npm install relyq
```

Creation:

```javascript
var redis = require('redis'),
  cli = redis.createClient();

var relyq = require('relyq'),
  q = new relyq.Q(cli, 'my-relyq');
```

Operations:

- `q.push(task, function (err, todo_len) {...})`
- `q.process(function (err, task) {...})`
- `q.finish(task, function (err, finish_len) {...})` An error is passed if the task does not exist in the in process queue.
- `q.fail(task, function (err, finish_len) {...})` An error is passed if the task does not exist in the in process queue.

## Tests

```
npm install -g nodeunit
npm install --dev
npm test
```

## License

See LICENSE file.

[1]: https://travis-ci.org/yanatan16/node-relyq.png?branch=master
[2]: http://travis-ci.org/yanatan16/node-relyq
{'fraction_non_alphanumeric': 0.15377894276976845, 'fraction_numerical': 0.00873743993010048, 'mean_word_length': 4.276497695852535, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 4, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5637817', 'n_tokens_mistral': 826, 'n_tokens_neox': 785, 'n_words': 256}