-
Notifications
You must be signed in to change notification settings - Fork 76
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Enhancements for PGMQueue Python Library #216
Comments
Great ideas @tavallaie . Here's some thoughts: For all of these features that already have a corresponding SQL function, I think it makes a lot of sense to just implement the function in the python lib. I like the requeue idea, and we can probably implement that using Pause and resume would be nice features too. Are you thinking this would prevent new messages from being able to reach the queue, or just prevent existing messages from being consumed? |
I'm sorry for being late :) |
I think the above are great ideas as well, I love the requeue/ |
I am working on features, but lately I was busy with my daily job. So I don't have enough time to implement all. any contributions more than welcome. |
I think having both options would be very useful:
This will be very helpful for machine learning or other heavy tasks. By stopping new messages from entering the queue, we can avoid overloading the system. For example, during system maintenance or upgrades, we can pause new messages to ensure no new data interferes with the process. By pausing the consumption of existing messages, we can manage the processing load better. This is useful when we need to allocate resources to more urgent tasks or when performing intensive computations. These features will help keep the system stable and efficient. |
I think both concerns are probably of the application using the library, not of the library itself. |
I think I agree. But, @tavallaie could you explain a bit more about the conditions or scenario where something sets the queue as "paused" for both concerns? In the case of consumers that are executing heavy tasks and are getting overloaded, what I typically see designs where the workers are told to stop consuming, rather than the queue told to stop accepting / distributing messages. A very common use case of a queue is to buffer the messages from the workers, so that the workers can decide when to pull in new work rather than having the works force fed the work, regardless of their ability to take on new work. Although as an admin functionality, I could see having the ability to set the visibility of all existing messages at once, like a
@tavallaie , in this scenario, what are you thinking the producers of the messages would need to do during "paused" periods? Would they receive errors when publishing? It seems like to producers, a "paused" queue would be no different than the database being down? |
@ChuckHend, I will test different scenarios to understand these features better. This will show us if they are useful and if they should be in the SDK or done by the user. Maybe it is better to have a separate issue for this discussion so other things solved in this issue can be closed. |
I am considering adding new functionalities to the PGMQueue library to enhance its capabilities. Below is a list of potential functions. I am seeking input from other developers on which functions should be prioritized, and any additional suggestions.
Potential New Functions
1. Queue Status/Length:
get_queue_length
: Get the current number of messages in the queue.2. Queue Monitoring:
get_queue_stats
: Retrieve various statistics about the queue, such as the number of messages enqueued, processed, failed, etc.3. Message Management:
requeue_message
: Requeue a specific message to process it again.update_message
: Update the content of a specific message in the queue.4. Batch Operations:
delete_batch
: Delete a batch of messages by their IDs.archive_batch
: Archive a batch of messages by their IDs.5. Advanced Queue Operations:
pause_queue
: Temporarily pause processing of messages in the queue. (Requires schema changes)resume_queue
: Resume processing of messages in a paused queue. (Requires schema changes)delete_queue
: Delete an entire queue and all its messages. (May require schema changes)6. Message Retrieval:
peek_message
: Retrieve a message without removing it from the queue.peek_batch
: Retrieve a batch of messages without removing them from the queue.How You Can Help
Please provide feedback on the following:
The text was updated successfully, but these errors were encountered: