Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions example/bee.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,23 @@ async function main() {
const server = new RedisServer(REDIS_SERVER_PORT);
await server.open();

const queue = new Bee('name_of_my_queue', {
redis: {
port: REDIS_SERVER_PORT,
},
});

// Fake process function to move newly created jobs in the UI through a few of the job states.
queue.process(async function (job) {
// Wait 5sec
await new Promise((res) => setTimeout(res, 5000));

// Randomly succeeds or fails the job to put some jobs in completed and some in failed.
if (Math.random() > 0.5) {
throw new Error('fake error');
}
});

Arena(
{
Bee,
Expand Down