I
I
icefleen2021-08-02 13:11:46
Software design
icefleen, 2021-08-02 13:11:46

Is there a ready-made architectural approach to repetitive timer tasks?

I have a react app with mobx stores declared as classes. Some methods of these classes must be called at regular intervals, usually from an hour to several hours. Instead of declaring timers inside these classes, I would like to have a separate place where you could transfer your tasks by conditionally calling some .register(callback, seconds). There is a feeling that this problem has been solved a long time ago, and there is a design pattern for it, therefore, it is not worth reinventing your wheel. Tell me, please, are my guesses correct, and if so, where can I read about it?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
I
Ivan Shumov, 2021-08-02
@inoise

In CQRS, the first C is Command. Commands are sent to the server, and then one of the available options receives its status according to the task ID. There are many ways: from recurrent requests to api to push and websockets

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question