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 .
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 raiseExecutionDeferred
andExecutionFailed
exceptions with appropriate messages. Moreover, this approach, makes the method no longer responsible for service status updates .