-
Notifications
You must be signed in to change notification settings - Fork 22
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
Remove implicit_init from the WorkContext #647
Conversation
added some suggestions, otherwise, I think it's okay |
Co-authored-by: shadeofblue <[email protected]>
yapapi/executor/__init__.py
Outdated
if self._implicit_init: | ||
work_context.deploy() | ||
work_context.start() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These two calls add commands to the internal Script
instance kept by a WorkContext
. When the non-deprecated way of creating scripts is used (i.e. calling new_script
on the WorkContext
and adding steps to that Script
) in the requestor application, these commands will end up never being called.
One option I can think of is to perform the implicit init in WorkContext#new_script
and use an internal bool flag to check whether deploy/start should be added to the newly returned Script
instance.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
:(
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed in bc86bae, hopefully.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've chosen other solution than proposed because now everything is still in Executor, without any implicit-init related things in WorkContext and I think there's some value in having this in a single place.
the issue I have is that we're adding overhead of sending two batches (one with the init, and one with commands coming from the client code) instead of just one, where the user script is prepended with the init |
Do you know any reason why this should be harmful? Maybe a simple solution would be to merge those two batch generators into a single one? I tried that first, but this was too hard for me :/ But I could give it another try if you think this is important. |
harmful might be too strong a word, rather potentially suboptimal performance-wise... |
As far as I understand the Executor/Engine code, this makes ~~ 0 difference from the performance POV. |
it's not about Executor/Engine - it's about provider <-> requestor communications.... |
resolves #649
Also: fixes current problem with services without
start()
method.