Replies: 1 comment 2 replies
-
It'd be nice to avoid the polling, I agree. The downside is we'd need to bypass the ORM, as it's platform-specific (and not in I'm not sure how |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Postgres implements PubSub channels with the NOTIFY and LISTEN statements. This means that a worker doesn't have to periodically poll the database to get more tasks, it can just wait for notifications.
This might actually be counter-productive for high-volume setups – if there are always tasks in the queue, polling will always return a task, and the notifications are just overhead – but for low-volume sites, where a single worker spends most of its time idle, this would save a bunch of CPU cycles.
Beta Was this translation helpful? Give feedback.
All reactions