Conversation
Add important comment to Executor
@vpetersson This PR is ready for merge. |
@a-martynovich noted on the older versions - that's fine in this stage. How do we control the granularity of the periodic runs and how are they run right now? |
Lines 51 to 59 in 61ccadf
Here’s how ping is run right now. Hopefully this code speaks for itself. |
Got it - yep. So i guess what we need to do is to start breaking ping apart and classify how often various operations should run. |
@a-martynovich is is possible to test your new code? |
@rptrchv Manually for now. Proper automated testing for this will take a lot of time to code. |
lgtm |
Closes #35
The new Executor allows to schedule periodic or one-shot execution of a function in separate process. An arbitrary number of functions can be scheduled, but only MAX_WORKERS processes will be spawned, which is the max number of simultaneously executed functions while others are waiting.
If a function crashes it won't destroy the main process. All function's stdout/stderr is attached to the main process. If a function hangs longer than the specified timeout its process gets killed. All spawned processes are destroyed at main process exit.
A function can be scheduled at any time. It is also possible to stop periodic execution of a single function.