Open lukicdarkoo opened 3 years ago
@lukicdarkoo have you considered:
With that in mind, I'd suggest we add support for a condition to respawn in addition to plain booleans, instead of hard-coding this check.
?
@lukicdarkoo have you considered:
With that in mind, I'd suggest we add support for a condition to respawn in addition to plain booleans, instead of hard-coding this check.
?
Sounds very good to me, but I understood that @ivanpauno and @wjwwood have to agree or contribute to the idea?
With that in mind, I'd suggest we add support for a condition to respawn in addition to plain booleans, instead of hard-coding this check. @ivanpauno @wjwwood for feedback.
Sounds fair, but how do you get the return code in the condition?
Sounds fair, but how do you get the return code in the condition?
Hmm. Didn't put a lot of thought to it. Temporarily pushing it to context.locals
is one option.
Hmm. Didn't put a lot of thought to it. Temporarily pushing it to context.locals is one option.
That works, but it's really weird IMO. I would rather let the user pass a callback which takes the return code as its only argument. We could also accept a two arguments version, where the second one is the context, though I don't think that's really useful.
I would rather let the user pass a callback which takes the return code as its only argument.
Right, but that'd make it impossible to leverage the feature from non-Python launch files.
I'm onboard with accepting callbacks for user convenience, but we have to accept a condition as well i.e. a construct that actually lives in launch
conceptual domain.
Okay, pushing it to context.locals
sounds fair to me.
Okay, pushing it to context.locals sounds fair to me.
Same.
@lukicdarkoo will you be moving forward with this?
@lukicdarkoo friendly ping
I believe there is a missing condition
returncode != 0
when respawning a process. I have a process that finishes cleanly after a short time, but the launcher keeps respawning it. With the condition (returncode != 0
) it works fine.