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
{{ message }}
This repository has been archived by the owner on Nov 6, 2019. It is now read-only.
As I have understood, in this code reverse is the name of job to be performed.
So we need to have the name of all jobs beforehand and save on another collection so the process which will run the job can fetch the names of the job first and then register the worker with fetched job name.
That's how I tried to follow and implement your code. But I ran into multiple issues:-
If it is supposed to be job queue then why are fetching the name of jobs to be processed.
The code should've been like while there are pending jobs { fetch all pending jobs process them and update the status }
There should've been no relation of the worker.register() to name of the job(because it is queue and queue doesn't care what job should be run first . It should work in the order we have created them or based on priority) , but here it looks more like a job dictionary than being a job queue.
The Job queues provided by laravel queue is a decent implementation while your seems vague.
If I am wrong ,Pls correct me because there are not much sample codes here and there is not much given to the one shown in sample(like how to set priority and attempt frequency etc) .
It is very vague.
The text was updated successfully, but these errors were encountered:
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
worker.register({ reverse: function (params, callback) { try { var reversed = params.text.split('').reverse().join(''); callback(null, reversed); } catch (err) { callback(err); } } });
As I have understood, in this code
reverse
is the name of job to be performed.So we need to have the name of all jobs beforehand and save on another collection so the process which will run the job can fetch the names of the job first and then register the worker with fetched job name.
That's how I tried to follow and implement your code. But I ran into multiple issues:-
If it is supposed to be job queue then why are fetching the name of jobs to be processed.
The code should've been like
while there are pending jobs { fetch all pending jobs process them and update the status }
There should've been no relation of the worker.register() to name of the job(because it is queue and queue doesn't care what job should be run first . It should work in the order we have created them or based on priority) , but here it looks more like a job dictionary than being a job queue.
The Job queues provided by laravel queue is a decent implementation while your seems vague.
If I am wrong ,Pls correct me because there are not much sample codes here and there is not much given to the one shown in sample(like how to set priority and attempt frequency etc) .
It is very vague.
The text was updated successfully, but these errors were encountered: