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

Ability to pass Queue instance instead of constructor + options in config #310

Open
bogdan opened this issue Jan 11, 2021 · 0 comments
Open

Comments

@bogdan
Copy link
Contributor

bogdan commented Jan 11, 2021

Our queues have some advanced configuration like:

export const MailerQueue = new Queue<{
  name: Name;
  params: Serializable;
}>('MailerQueue', {
  limiter: {
    max: 100,
    duration: 5 * 1000,
  },
  defaultJobOptions: {
    attempts: 3,
    backoff: 60 * 1000,
  },
);

All of that configuration is lost when job is made via this tool.

It can be fixed by introducing the ability to pass a Queue instance as the configuration options instead of constructor + config, like:

const arena = Arena(
  {
    queues: [MailerQueue],
  },
);

instead of:

const arent = Arena({
queues: {
  hostId: 'main',
  name: "MailerQueue",
  url: config.REDIS_URL,
  type: 'bull',
},
Bull: Queue,
});

Are you open for a PR with such a feature?

@bogdan bogdan changed the title Ability to pass Queue instance instead of Queue contrcutor + configuration to an application Ability to pass Queue instance instead of constructor + configuration in config Jan 11, 2021
@bogdan bogdan changed the title Ability to pass Queue instance instead of constructor + configuration in config Ability to pass Queue instance instead of constructor + options in config Jan 11, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant