Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/zswang/xqueue

Emitter at Redis queue
https://github.com/zswang/xqueue

emitter publish queue redis subscribe

Last synced: about 1 month ago
JSON representation

Emitter at Redis queue

Awesome Lists containing this project

README

        

# xqueue

Emitter at Redis queue

[![NPM version][npm-image]][npm-url] [![Build Status][travis-image]][travis-url] [![Coverage Status][coverage-image]][coverage-url]

## xqueue:emitter:listener:${type}

* emit(type, data)

```redis
SMEMBERS xqueue:emitter:listener:${type}
RPUSHX xqueue:emitter:encoding:${type}:${encoding}
SREM xqueue:emitter:encoding:${type}:${encoding}
```

* on(type, encoding, fn)

```redis
RPUSH xqueue:emitter:encoding:${type}:${encoding} :nil
EXPIRE xqueue:emitter:encoding:${type}:${encoding} ${expire}
SADD xqueue:emitter:listener:${type} ${encoding}

while (true) {
LPOP xqueue:emitter:encoding:${type}:${encoding}
sleep()
}
```

## License

MIT © [zswang](http://weibo.com/zswang)

[npm-url]: https://badge.fury.io/js/xqueue
[npm-image]: https://badge.fury.io/js/xqueue.svg
[travis-url]: https://travis-ci.org/zswang/xqueue
[travis-image]: https://travis-ci.org/zswang/xqueue.svg?branch=master
[coverage-url]: https://coveralls.io/github/zswang/xqueue?branch=master
[coverage-image]: https://coveralls.io/repos/zswang/xqueue/badge.svg?branch=master&service=github