Use kiwipy to send early response for continue/launch/create without releasing task slot#338
Draft
agoscinski wants to merge 2 commits intoaiidateam:masterfrom
Draft
Use kiwipy to send early response for continue/launch/create without releasing task slot#338agoscinski wants to merge 2 commits intoaiidateam:masterfrom
agoscinski wants to merge 2 commits intoaiidateam:masterfrom
Conversation
- ProcessLauncher._launch and _continue now return TaskResult with task_id (PID) and result Future - kiwipy handles early reply (sends PID immediately when nowait=True) and waits for result Future before acking - Simplify ProcessLauncher.__call__ to 2-arg signature (comm, task) since incoming_task is no longer needed - Update tests to handle TaskResult and use 2-arg subscriber signature
agoscinski
commented
Mar 3, 2026
| # Start process in background, return TaskResult with Future | ||
| # kiwipy will handle early reply (if nowait) and wait for Future before acking | ||
| asyncio.ensure_future(proc.step_until_terminated()) # noqa: RUF006 | ||
| return TaskResult(task_id=proc.pid, result=communications.plum_to_kiwi_future(proc.future())) |
Contributor
Author
There was a problem hiding this comment.
what is proc.future().result() actually again, is it always pid?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
For the scheduler feature we want to be able to send responses like
pause,playandkillto verify that the message has been received. We however cannot use the existing functionalities used inpause/play/killbecause it would release the task slot. We therefore added a early response functionality into kiwipy to be able to send a responsecontinuereply without releasing the task slot (that is required to enforce thedaemon.worker_process_slotsin the aiida config)