We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 6fb9bdb + 7c0bc7c commit 982bf6fCopy full SHA for 982bf6f
1 file changed
example/bee.js
@@ -12,6 +12,23 @@ async function main() {
12
const server = new RedisServer(REDIS_SERVER_PORT);
13
await server.open();
14
15
+ const queue = new Bee('name_of_my_queue', {
16
+ redis: {
17
+ port: REDIS_SERVER_PORT,
18
+ },
19
+ });
20
+
21
+ // Fake process function to move newly created jobs in the UI through a few of the job states.
22
+ queue.process(async function (job) {
23
+ // Wait 5sec
24
+ await new Promise((res) => setTimeout(res, 5000));
25
26
+ // Randomly succeeds or fails the job to put some jobs in completed and some in failed.
27
+ if (Math.random() > 0.5) {
28
+ throw new Error('fake error');
29
+ }
30
31
32
Arena(
33
{
34
Bee,
0 commit comments