Currently worker's StopTask method is responsible for both stopping the process if it's running and deleting it from the tasks map.
Advantages of separating stop & delete:
- When there will be dedicated API for accessing task's logs, it can be useful to stop the task and check the logs. For instance, to verify how the task performed so-called graceful shutdown.
Advantages of keeping a combined stop & delete:
- The same as in Kubernetes π For sure, they know more than me about designing orchestration platforms.