Skip to content
This repository has been archived by the owner on Nov 6, 2019. It is now read-only.

how to retain job names on another process? #90

Open
shkrwnd opened this issue Jun 20, 2019 · 0 comments
Open

how to retain job names on another process? #90

shkrwnd opened this issue Jun 20, 2019 · 0 comments

Comments

@shkrwnd
Copy link

shkrwnd commented Jun 20, 2019

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.

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

No branches or pull requests

1 participant