better-queue
Advanced tools
Comparing version 3.8.10 to 3.8.11
@@ -649,3 +649,2 @@ var uuid = require('uuid'); | ||
tickets[taskId].progress(progress); | ||
delete tickets[taskId]; | ||
} | ||
@@ -652,0 +651,0 @@ self.emit('task_progress', taskId, progress); |
{ | ||
"name": "better-queue", | ||
"version": "3.8.10", | ||
"version": "3.8.11", | ||
"description": "Better Queue for NodeJS", | ||
@@ -30,3 +30,3 @@ "main": "lib/queue.js", | ||
"devDependencies": { | ||
"mocha": "^2.3.4", | ||
"mocha": "^10.0.0", | ||
"mocha-junit-reporter": "^1.12.1" | ||
@@ -37,4 +37,4 @@ }, | ||
"node-eta": "^0.9.0", | ||
"uuid": "^3.0.0" | ||
"uuid": "^9.0.0" | ||
} | ||
} |
@@ -8,3 +8,3 @@ # Better Queue - Powerful flow control | ||
[![Known Vulnerabilities](https://snyk.io/test/npm/better-queue/badge.svg?style=flat-square)](https://snyk.io/test/npm/better-queue) | ||
[![Gitter](https://img.shields.io/badge/gitter-join_chat-blue.svg?style=flat-square)](https://gitter.im/diamondio/better-queue?utm_source=badge) | ||
[![Gitter](https://img.shields.io/badge/gitter-join_chat-blue.svg?style=flat-square)](https://gitter.im/leanderlee/better-queue?utm_source=badge) | ||
@@ -60,2 +60,3 @@ | ||
- [Storage](#storage) | ||
- [Using with Webpack](#using-with-webpack) | ||
- [Full Documentation](#full-documentation) | ||
@@ -540,3 +541,3 @@ | ||
You can inspect the queue at any given time to see information about how many items are | ||
queued, average queue time, success rate and total item processed. | ||
queued, average queue time in milliseconds, success rate and total item processed. | ||
@@ -548,3 +549,3 @@ ```js | ||
// stats.total = Total tasks processed | ||
// stats.average = Average process time | ||
// stats.average = Average process time in milliseconds | ||
// stats.successRate = % success (between 0 and 1) | ||
@@ -588,2 +589,4 @@ // stats.peak = Most tasks queued at any given point in time | ||
Note that this requires `better-queue-sql` or `better-queue-sqlite`. | ||
#### PostgreSQL store (`npm install pg`) | ||
@@ -646,3 +649,44 @@ ``` | ||
--- | ||
## Using with Webpack | ||
Better Queue can be used in the browser using the default in-memory store. However you have to create and pass the store to its constructor. | ||
```js | ||
import Queue = require('better-queue') | ||
import MemoryStore = require('better-queue-memory') | ||
var q = new Queue(function (input, cb) { | ||
// Some processing here ... | ||
cb(null, result); | ||
}, | ||
{ | ||
store: new MemoryStore(), | ||
} | ||
) | ||
``` | ||
### TypeScript Support | ||
Better Queue can be used in TypeScript projects by installing type definitions from the [Definitely Typed](https://github.com/DefinitelyTyped/DefinitelyTyped) repository: | ||
```bash | ||
npm install --save @types/better-queue | ||
``` | ||
Afterwards, you can simply import the library: | ||
```ts | ||
import Queue = require('better-queue') | ||
const q: Queue = new Queue(() => {}); | ||
``` | ||
[back to top](#table-of-contents) | ||
--- | ||
## Full Documentation | ||
@@ -692,3 +736,3 @@ | ||
- `use(store)` - Sets the queue to read from and write to the given store. | ||
- `getStats()` - Gets the aggregate stats for the queue. Returns an object with properties `successRate`, `peak`, `total` and `average`, representing the success rate on tasks, peak number of items queued, total number of items processed and average processing time, respectively. | ||
- `getStats()` - Gets the aggregate stats for the queue. Returns an object with properties `successRate`, `peak`, `total` and `average`, representing the success rate on tasks, peak number of items queued, total number of items processed and average processing time in milliseconds, respectively. | ||
- `resetStats()` - Resets all of the aggregate stats. | ||
@@ -710,3 +754,3 @@ | ||
- `accept` - When the corresponding task is accepted (has passed filter) | ||
- `accepted` - When the corresponding task is accepted (has passed filter) | ||
- `queued` - When the corresponding task is queued (and saved into the store) | ||
@@ -713,0 +757,0 @@ - `started` - When the corresponding task is started |
78937
754
18
2028
+ Addeduuid@9.0.1(transitive)
- Removeduuid@3.4.0(transitive)
Updateduuid@^9.0.0