|
1 |
| -### Toureiro |
| 1 | +# Toureiro |
2 | 2 |
|
3 |
| -======== |
| 3 | +A graphical monitoring interface for the distributed job queue [bull](https://github.com/OptimalBits/bull) built using `express` and `react`. Toureiro provides simple monitoring features as well as the ability to promote delayed jobs directly. |
| 4 | + |
| 5 | +## Screenshots |
| 6 | + |
| 7 | +## Get Started |
| 8 | + |
| 9 | +First install `toureiro` from `npm`. |
| 10 | + |
| 11 | +``` |
| 12 | +npm install toureiro |
| 13 | +``` |
| 14 | + |
| 15 | +You can then use `toureiro` in your project. The constructor `toureiro()` will return an `express` app, which you can then have it listen to any port you desire: |
| 16 | + |
| 17 | +```javascript |
| 18 | +var toureiro = require('toureiro'); |
| 19 | +var app = toureiro(); |
| 20 | +var server = app.listen(3000, function() { |
| 21 | + console.log('Toureiro is now listening at port 3000...'); |
| 22 | +}); |
| 23 | +``` |
| 24 | + |
| 25 | +Or you can mount it to a subpath for your own `express` server: |
| 26 | + |
| 27 | +```javascript |
| 28 | +var express = require('express'); |
| 29 | +var toureiro = require('toureiro'); |
| 30 | + |
| 31 | +var app = express(); |
| 32 | +/** |
| 33 | + * Your own setup... |
| 34 | + */ |
| 35 | +app.use('/toureiro', toureiro()); |
| 36 | + |
| 37 | +var server = app.listen(8080); |
| 38 | +``` |
| 39 | + |
| 40 | +You can also run `toureiro` as a standalone program: |
| 41 | + |
| 42 | +```bash |
| 43 | +> toureiro |
| 44 | +Toureiro is now listening at port 3000... |
| 45 | +``` |
| 46 | + |
| 47 | +## Config |
| 48 | + |
| 49 | +By default, `toureiro` will try to connect to the redis db #0 at 127.0.0.1:6379, but you can configure it yourself: |
| 50 | + |
| 51 | +```javascript |
| 52 | +var app = toureiro({ |
| 53 | + // Options to be passed directly to redis.createClient(), |
| 54 | + // see https://github.com/NodeRedis/node_redis#rediscreateclient |
| 55 | + redis: { |
| 56 | + // Redis host |
| 57 | + host: '127.0.0.1', |
| 58 | + // Port |
| 59 | + port: 6379 |
| 60 | + // DB number |
| 61 | + db: 1 |
| 62 | + // Other redis options... |
| 63 | + } |
| 64 | +}); |
| 65 | +``` |
| 66 | + |
| 67 | +## Usage |
| 68 | + |
| 69 | +``` |
| 70 | +
|
| 71 | +``` |
| 72 | + |
| 73 | +## Why Bull? |
| 74 | + |
| 75 | +Distributed task queue is a necessity in a lot of use cases. Among all the queues out there, [Celery](http://www.celeryproject.org/) is probably the most prominent and has the biggest community. However, it's hard to integrate `Celery` into the Node.js programs, simply because that's another language environment to maintain. Therefore, a javascript native task queue is much needed. |
| 76 | + |
| 77 | +Among the queues written for `javascript`, [Kue](https://github.com/Automattic/kue.git) is the most widely used one. `Kue` is a great library, and we have relied heavily on `Kue` before, but we are gradually troubled by the various bugs of the library. Due to the time when `Kue` was first written, a lot of things weren't possible (for example, atomicity of complex `redis` operations, which is now enabled by the built-in `LUA` scripting engine). What's more, several important features (FIFO behavior of delayed jobs, for instance) are missing from `Kue` or are hard to implement due to the early design decisions. |
| 78 | + |
| 79 | +Then `bull` came along. It's written by the guys from OptimalBits and its APIs are modeled heavily after those of `Kue`. In its core, however, it's written very carefully (and differently from `Kue`) to ensure robustness and atomicity. Bugs that are common to distributed queue designs are not found with `bull` or have been fixed along the way. |
| 80 | + |
| 81 | +As awesome as `bull` is, the only thing that is missing is a web monitoring interface, much like that of `Kue`, so we decided to make our own, thus `toureiro` is born. |
| 82 | + |
| 83 | +## Browser Compatibility |
| 84 | + |
| 85 | +It's compatible with all modern browsers. Since the front end relies on `react`, and `react` does support all the way down to IE8, it's possible that IE8 will work as well, though with messy styles. |
| 86 | + |
| 87 | +## License |
| 88 | + |
| 89 | +The MIT License (MIT) |
| 90 | + |
| 91 | +Copyright (c) 2015 Epharmix <[email protected]> |
| 92 | + |
| 93 | +Permission is hereby granted, free of charge, to any person obtaining a copy |
| 94 | +of this software and associated documentation files (the "Software"), to deal |
| 95 | +in the Software without restriction, including without limitation the rights |
| 96 | +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell |
| 97 | +copies of the Software, and to permit persons to whom the Software is |
| 98 | +furnished to do so, subject to the following conditions: |
| 99 | + |
| 100 | +The above copyright notice and this permission notice shall be included in all |
| 101 | +copies or substantial portions of the Software. |
| 102 | + |
| 103 | +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
| 104 | +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
| 105 | +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE |
| 106 | +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER |
| 107 | +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, |
| 108 | +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE |
| 109 | +SOFTWARE. |
0 commit comments