-
Notifications
You must be signed in to change notification settings - Fork 653
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
RFC: Job based API #1946
Comments
@pvizeli I realy want to help implement this but I need some hint. @process_lock
def install(self, tag: str, image: Optional[str] = None, latest: bool = False):
"""Pull docker image."""
return self.sys_run_in_executor(self._install, tag, image, latest) |
I started something in #1805. |
Please make a new PR. Need a lot more code. Like an API and job manager as coresys object. The event is just a small part of this construct and replace also all locks on code. With test, that going into a 1-2 k line PR. |
Did you hear about MVP or KISS? :) |
For history: #2348 |
Implemented by #4514. |
Context
Currently, each API call can end up with using
process_lock
to guard an object against new action while a current action is running.Decision
We create a job monitor that replaces
process_lock
but works similarly and using https://docs.python.org/3/library/contextvars.html which makes it possible that we can call other function of this object without being deadlock or need to guard this.The API works like before, but for some calls, it creates tasks/jobs and a new API to manage/show these jobs or getting details like progress. The job monitor is allowing us to use the core event bus to inform the UI about start/stop or progress on this job.
And generate
/xy/update
which is set on the first context and gets inherit to child jobs. So the frontend can get the correct root job. We can also lock future access over this JobGroup. The question is, how we deal with sub progress etc.API:
Future
We can use this with logging to attach the right error message from deep back over the API to the UI.
The text was updated successfully, but these errors were encountered: