-
Notifications
You must be signed in to change notification settings - Fork 421
/
Copy pathqueue-options.ts
85 lines (74 loc) · 1.69 KB
/
queue-options.ts
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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
import { AdvancedRepeatOptions } from './advanced-options';
import { DefaultJobOptions } from './base-job-options';
import { ConnectionOptions } from './redis-options';
export enum ClientType {
blocking = 'blocking',
normal = 'normal',
}
/**
* Base Queue options
*/
export interface QueueBaseOptions {
/**
* Options for connecting to a Redis instance.
*/
connection?: ConnectionOptions;
/**
* Specify if the connection is shared.
*/
sharedConnection?: boolean;
/**
* Denotes commands should retry indefinitely.
*/
blockingConnection?: boolean;
/**
* Prefix for all queue keys.
*/
prefix?: string;
}
/**
* Options for the Queue class.
*/
export interface QueueOptions extends QueueBaseOptions {
defaultJobOptions?: DefaultJobOptions;
/**
* Options for the streams used internally in BullMQ.
*/
streams?: {
/**
* Options for the events stream.
*/
events: {
/**
* Max approximated length for streams. Default is 10 000 events.
*/
maxLen: number;
};
};
settings?: AdvancedRepeatOptions;
}
/**
* Options for the Repeat class.
*/
export interface RepeatBaseOptions extends QueueBaseOptions {
settings?: AdvancedRepeatOptions;
}
/**
* Options for QueueEvents
*/
export interface QueueEventsOptions extends QueueBaseOptions {
/**
* Condition to start listening to events at instance creation.
*/
autorun?: boolean;
/**
* Last event Id. If provided it is possible to continue
* consuming events from a known Id instead of from the last
* produced event.
*/
lastEventId?: string;
/**
* Timeout for the blocking XREAD call to the events stream.
*/
blockingTimeout?: number;
}