You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is there an existing issue that is already proposing this?
I have searched the existing issues
Is your feature request related to a problem? Please describe it
I have an observable in my processor, as following:
@Processor(BULLMQ_QUEUE_NAME)exportclassJobProcessorextendsWorkerHost{asyncprocess(job: Job<Record<string,any>>): Promise<any>{this.client.send('testFailure',5).pipe(timeout(5000)).subscribe({next: (data)=>console.log('successful job',data),error: (err)=>console.log('failed job'),// can not fail the job});}}
With promises, I can easily await a function, and based on my condition I can throw an error as the following and mark the job as failed:
thrownewError('job failed');
But with observables, I can't do this. If I put the throw inside the error section of observable, it doesn't work, because actually before that, the job is considered completed.
Note: I prefer not to use toPromise since it's deprecated.
Is there an existing issue that is already proposing this?
Is your feature request related to a problem? Please describe it
I have an observable in my processor, as following:
With promises, I can easily await a function, and based on my condition I can throw an error as the following and mark the job as
failed
:But with observables, I can't do this. If I put the
throw
inside the error section of observable, it doesn't work, because actually before that, the job is consideredcompleted
.Note: I prefer not to use
toPromise
since it's deprecated.Describe the solution you'd like
Any possible way to accomplish this issue
Teachability, documentation, adoption, migration strategy
No response
What is the motivation / use case for changing the behavior?
Ability to use microservice client and in case of an issue with connection while sending the message, we could mark the job as failed.
The text was updated successfully, but these errors were encountered: