Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(bullmq): allow setting custom jobs options when dispatching #2484

Merged

Conversation

abenerd
Copy link
Contributor

@abenerd abenerd commented Oct 24, 2023

Information

Type Breaking change
Feature No

Allow setting job options when dispatching a job

import {Service} from "@tsed/di";
import {JobDispatcher} from "@tsed/bullmq";
import {ExampleJob} from "./jobs/ExampleJob";

@Service()
class MyService {
  constructor(private readonly dispatcher: JobDispatcher) {}

  public async doingSomething() {
    await this.dispatcher.dispatch(ExampleJob, {msg: "this message is part of the payload for the job"}, {
      delay: 600_000 // 10 minutes in milliseconds
    });

    console.info("I just dispatched a job!");
  }
}

Todos

  • Tests
  • Coverage
  • Example
  • Documentation

@Romakita Romakita merged commit f76b35f into tsedio:production Oct 25, 2023
19 checks passed
@Romakita
Copy link
Collaborator

🎉 This PR is included in version 7.40.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants