Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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
- Host: GitHub
- URL: https://github.com/zswang/xqueue
- Owner: zswang
- License: mit
- Created: 2017-12-01T13:31:36.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2018-10-09T14:02:12.000Z (about 6 years ago)
- Last Synced: 2024-10-05T10:06:20.307Z (about 1 month ago)
- Topics: emitter, publish, queue, redis, subscribe
- Language: JavaScript
- Size: 40 KB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
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