-
Notifications
You must be signed in to change notification settings - Fork 228
Expand file tree
/
Copy pathqueue.js
More file actions
51 lines (41 loc) · 1.08 KB
/
queue.js
File metadata and controls
51 lines (41 loc) · 1.08 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
const NotImplementedError = require('../error/NotImplementedError');
module.exports = class Queue {
constructor(queue) {
this._queue = queue;
if (new.target === Queue) {
throw new TypeError("Cannot construct Queue instances directly");
}
}
static parseRedisConfig({port, host, db, password, url, redis, tls}) {
const redisHost = {host};
if (password) redisHost.password = password;
if (port) redisHost.port = port;
if (db) redisHost.db = db;
if (tls) redisHost.tls = tls;
return redis || url || redisHost;
}
get redisClient() {
return this._queue.client;
}
async getJob(_id) {
throw new NotImplementedError();
}
async getJobCounts() {
throw new NotImplementedError();
}
async getJobs(_state, _start, _size) {
throw new NotImplementedError();
}
async addJob(_data, _options) {
throw new NotImplementedError();
}
isValidState(_state) {
throw new NotImplementedError();
}
isActionSupported(_action) {
throw new NotImplementedError();
}
isPaginationSupported(_state) {
return true;
}
};