Separating job/queue/task definition/configuration from enqueuing #85
-
|
First of all, thanks a lot for all your work! This is one of the best documented persistent job queues I could find in Rust. Thanks a lot! I am still a little stuck here on the best/proper way to define/configure tasks/queues and separate that from enqueuing. What I want to achieve is something like:
From what I am reading the docs, I will need to keep references from the boot setup phase in a global state so that I can call the enqueue on these references in other parts of the server. On the workers side it is easier because I can start workers and just wait for the shutdown signal. Is there a way to call enqueue without needing these references? Am I missing something here? I feel like this scenario is the typical use-case here but still I don't think I've seen an example with this kind of scenario. Sorry if I missed anything from the docs/repo. P.S.: I am new to Rust ;) I was spoiled by the excellent Oban library in Elixir which is very easy and performant... They have some impressive architecture and work on this subject that might be interesting as a research area: |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 7 replies
-
You can enqueue manually if you like, but you'll still need to provide a |
Beta Was this translation helpful? Give feedback.
-
|
Hi @imothee ! Have you had a chance to test your designs? I am quite interested in trying it out :) Both ways seems it would work for my use-cases. Also, more people seem to be asking the same question (looking in the discussions). I could also try and cook it up myself if time is tight on your side. Thanks for bringing ideas to this thread! |
Beta Was this translation helpful? Give feedback.
It wouldn't really be possible to do that in a type safe way, if I'm following what you're asking for.
Put differently, we intentionally don't expose a public API via Postgres (because that wouldn't enforce type safety!)