Skip to content
This repository has been archived by the owner on May 3, 2024. It is now read-only.
Ahmet edited this page May 3, 2018 · 5 revisions
queue
  .add({
    handler: "SendEmail",
    tag: "email-sender",
    args: { email: "[email protected]", fullname: "John Doe" },
    priority: 2,
  })
  .then(result => {
    // do something
  });

// Example before event
queue.on("email-sender:before", function() {
  // do something
});
queue.on("[tag]:before", function() {
  // ...
});
queue.on("[tag]:after", function() {
  // ...
});

Tag specific wildcard events.

queue.on("[tag]:*", function() {
  // ...
});

Wildcard events.

queue.on("*", function() {
  // ...
});

All error events.

queue.on("error", function() {
  // ...
});
Clone this wiki locally