Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

We have a job table that triggers a notification when a new job gets inserted. C

ID: 644469 • Letter: W

Question

We have a job table that triggers a notification when a new job gets inserted. Clients that can handle such jobs may subscribe to those notifications. When a client receives a notification, he can "lock" the job, so no other client will try to process it. We have also take care of errors and if a job takes to long to process.

Problem: A client can only handle X jobs at the same time. On heavy load, all clients are busy handling their jobs. And new jobs may not get handled right away. If the client is no longer busy, he may query the table to find jobs that have not been processed yet. But if all clients stay busy for a long time (they finish jobs but new jobs arrive at the same time), those old jobs will never be processed.

Idea: After a client has processed Y jobs, he ignores all new jobs, and queries the table for the old ones. But I am not really comfortable with that idea.

Any ideas by you? If you need more information don't hesitate to ask for them.

Explanation / Answer

If I understand your question correctly, I think the following approach should work:

If a client ignores a notification once, because of its load, it ignores all following notifications too (even if the load decreases). From then on, it relies only on querying the database for old requests. Once all old requests are handled, it will start accepting notifications again.

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote