rq icon indicating copy to clipboard operation
rq copied to clipboard

Support for custom class in Job class for custom Failed-, Started-, Finished-, ... -JobRegistry classes?

Open dvaerum opened this issue 2 years ago • 3 comments

Both in the Queue class in the Worker class, can one find queue_class job_class https://github.com/rq/rq/blob/v1.10.1/rq/queue.py#L40 https://github.com/rq/rq/blob/v1.10.1/rq/worker.py#L101-L102

But what about making it possible in the Job to support custom Failed-, Started-, Finished-, ... -JobRegistry is it something that would be interest for, if I were to make a pull request with it? 😁 Because It would be useful to me to have this feature supported, but I can live without 😐

dvaerum avatar May 03 '22 07:05 dvaerum

What kind of features specifically do you need in implementing custom registry classes?

selwin avatar Jul 01 '22 00:07 selwin

Mainly, I want to be able to overwrite Redis key naming scheme for Failed-, Started-, Finished-, ... -JobRegistry

dvaerum avatar Jul 03 '22 19:07 dvaerum

Well, there have been requests about adding support for namespaces. I suppose this is something we can consider, so you can do something like:

queue = Queue(name='foo', namespace='bar', connection=Redis)

I don't mind accepting a PR for this feature, but I'll warn you in advance that this will likely touch many areas in RQ's code base so the PR would be rather large.

selwin avatar Aug 07 '22 04:08 selwin

I can, imagine, but at this point I have already been working on overwrites of the code, but using custom classes to achieve namespaces, so I think it would be a better to spend some time on trying to add the feature, hopefully I will get time in the new year to start working on it/take a look at it again

dvaerum avatar Nov 18 '22 19:11 dvaerum