T
T
Tony2018-02-06 19:46:44
Qt
Tony, 2018-02-06 19:46:44

How to implement task queue processing?

Tell me, please, how best to implement the following requirements in c ++ and qt:
I need to implement reading commands from the database (they are in postgresql), executing them and writing the result back to the database. Some (or maybe all for consistency) command handlers will run on threads. I would like to make a beautiful abstraction, and not like I have now, where a handler is created for each type of command, which periodically reads the table, performs one task at a time and writes the result to the database itself.
I would appreciate any help, thanks.
*Update*
Here's a design I made https://github.com/antoncarrot/qt-signals-example
Browser turned out to get the result.
The Manager periodically reads the database, and the handlers execute the task if the task type matches the handler type. There was another option without signals and slots, passing a pointer to the Manager object.
Is this implementation normal or are there better options?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
J
Jacob E, 2018-02-06
@Zifix

Too abstract question.
PS Increasing the number of threads for uniformity sounds unprofessional.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question