forked from aiidateam/plumpy
-
Notifications
You must be signed in to change notification settings - Fork 0
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
Rmq move out as an extra module #6
Merged
Conversation
This file contains 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
Merged
unkcpz
force-pushed
the
rmq-out
branch
4 times, most recently
from
January 17, 2025 22:37
2304d5f
to
6e84968
Compare
…and asyncio.Future hand write wrap to kiwipy future (concurrent.futures.Future) kiwipy.Future -> concurrent.futures.Future
Move communication to rmq
unkcpz
force-pushed
the
rmq-out
branch
2 times, most recently
from
January 17, 2025 22:42
4972dd2
to
6d3101d
Compare
10 tasks
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.
The refactoring is targeting to decouple the dependencies of using kiwipy+rmq as the communicator for the process control.
By forming a
Coordinator
protocol contract, the different type of rmq/kiwipy related codes are removed out from plumpy logic. The new contract also pave the way to make it clearly show how a new type coordinator can be implemented (future examples will be thetatzelwurm
a task broker that has scheduler support and file based task broker require no background service).For the prototype of how a coordinator should look like, the
MockCoordinator
intests/utils
is the coordinator that store things in memory, and can serve as the lightweight ephemeral daemon without persistent functionality.Another major change here is hand write the resolver of future by mimic how tho asyncio does for wrapping
concurrent.futures.Future
intoasyncio.Future
. I use the same way to convertasyncio.Future
intoconcurent.futures.Future
(which is thekiwipy.Future
as alias).aio_pika
import lazily by moving the rmq exceptions tormq
module, this can increase the performance ofimport aiida; aiida.orm
.CancellableAction
using composite to behave as a Future like object.asyncio.Future
in favor of aliasplumpy.Future
andconcurrent.futures.Future
instead of aliaskiwipy.Future
._chain
and_copy_future
since we can not just rely on the API of asyncio that is not exposed.coordinator/Communicator
protocol.coordinator/Coordinator
protocol and wrap rmq/communicator as a coordinator that not require changs in kiwipy.