bartongroup / slivka

http://bartongroup.github.io/slivka/
Apache License 2.0
7 stars 3 forks source link

Scheduler#run_requests should raise an exception on failed submission. #104

Closed warownia1 closed 2 years ago

warownia1 commented 3 years ago

Both request submission delay or failure is an indicator of some error and should be indicated by a raised exception. Current solution is no different than returning a flag, but uglier. Also, there is no need to return the requests back to the caller. I propose changing method signature to run_requests(Sequence[JobRequest]) -> Sequence[Job] and raise ExecutionDeferred and ExecutionFailed exceptions with appropriate messages. Moreover, this approach, makes the method no longer responsible for service status updates .