https://github.com/codeanker/feathers-bee
Bee Queue as feathers-plugin
https://github.com/codeanker/feathers-bee
bee-queue feathers-bee feathersjs
Last synced: about 2 months ago
JSON representation
Bee Queue as feathers-plugin
- Host: GitHub
- URL: https://github.com/codeanker/feathers-bee
- Owner: codeanker
- License: mit
- Created: 2017-09-04T14:15:51.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2019-07-22T22:39:17.000Z (over 6 years ago)
- Last Synced: 2025-12-13T13:16:17.471Z (4 months ago)
- Topics: bee-queue, feathers-bee, feathersjs
- Language: JavaScript
- Homepage:
- Size: 939 KB
- Stars: 5
- Watchers: 4
- Forks: 0
- Open Issues: 6
-
Metadata Files:
- Readme: README.md
- Contributing: .github/contributing.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
# feathers-bee
[](https://greenkeeper.io/)
[](https://codeclimate.com/github/codeanker/feathers-bee)
[](https://david-dm.org/codeanker/feathers-bee)
[](https://www.npmjs.com/package/feathers-bee)
## Installation
```
npm install feathers-bee --save
```
## Documentation
### Setup
```js
app.use('/bee', bee({
service: app.service('serviceToLog'), // add your service
name: 'example'
}));
```
### Plugin Args
* **service:** The service to log
* **name:** Name of the Queue
* **queue:** Settings of the Queue
* **paginate:** The default pagenate stuff
### Bee Queue events
The [bee-queue events](https://github.com/bee-queue/bee-queue#queue-local-events) are implemented as custom feathers events
## Usage
* **Create a new job:** call create at the bee service to create a new job
* **Get a job:** call get with a job id to get a job
* **Find jobs:** call find at the bee service to find the waiting jobs
* change type with params
## Complete Example
Here's an example of a Feathers server that uses `feathers-bee`.
```js
const feathers = require('feathers');
const rest = require('feathers-rest');
const socketio = require('feathers-socketio');
const handler = require('feathers-errors/handler');
const bodyParser = require('body-parser');
const memory = require('feathers-memory');
const bee = require('feathers-bee');
// Create a feathers instance.
const app = feathers()
.configure(socketio())
.configure(rest())
.use(bodyParser.json())
.use(bodyParser.urlencoded({extended: true}));
// Create any service you like.
app.use('/messages', memory({
paginate: {
default: 2,
max: 4
},
id:'_id'
}));
// Create bee service
app.use('/bee', bee({
service: app.service('messages'), // add your service
name: 'example', // name
queue: {}, // queue settings
paginate: {
default: 2,
max: 4
}
}));
// A basic error handler, just like Express
app.use(handler());
// Start the server
var server = app.listen(3030);
server.on('listening', function () {
console.log('Feathers running on 127.0.0.1:3030');
});
```
## License
Copyright (c) 2017
Licensed under the [MIT license](LICENSE).