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

Missing WorkerOptions types on BullQueueAdvancedProcessor and BullQueueAdvancedSeparateProcessor #1971

Open
2 of 4 tasks
jointhejourney opened this issue Jan 20, 2024 · 1 comment
Labels
bug Something isn't working needs triage

Comments

@jointhejourney
Copy link

jointhejourney commented Jan 20, 2024

Is there an existing issue for this?

  • I have searched the existing issues

Current behavior

Hi,

Currently, additional WorkerOptions from BullMQ are not presented in these advanced queue processor types:

export interface BullQueueAdvancedProcessor {
concurrency?: number;
name?: string;
callback: BullQueueProcessorCallback;
}
export interface BullQueueAdvancedSeparateProcessor {
concurrency?: number;
name?: string;
path: BullQueueSeparateProcessor;
}

So if you try to use additional options such as limiter: {}, the types aren't present. However it works just fine since the options are just relayed to the Worker class:

const { callback, ...processorOptions } = processor;
return new workerClass(queueName, callback, {
connection: options.connection,
sharedConnection: options.sharedConnection,
prefix: options.prefix,
...processorOptions,

We could just extend the interface here: https://github.com/taskforcesh/bullmq/blob/b28981938e8a4504905363551544633d9734e20f/src/interfaces/worker-options.ts#L16

If this looks good, I can put up a PR. Thank you for all your work.

Minimum reproduction code

N/A

Package version

10.0.1

Bull version

4.17.0

NestJS version

10.3.0

Node.js version

18.19.0

In which operating systems have you tested?

  • macOS
  • Windows
  • Linux

Other

No response

@jointhejourney jointhejourney added bug Something isn't working needs triage labels Jan 20, 2024
@jointhejourney jointhejourney changed the title Missing WorkerOptions types on Missing WorkerOptions types on BullQueueAdvancedProcessor and BullQueueAdvancedSeparateProcessor Jan 20, 2024
@kamilmysliwiec
Copy link
Member

Would you like to create a PR for this issue?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working needs triage
Projects
None yet
Development

No branches or pull requests

2 participants