diff --git a/docs/source/concepts.md b/docs/source/concepts.md index ba6e8b17..0c39d515 100644 --- a/docs/source/concepts.md +++ b/docs/source/concepts.md @@ -32,7 +32,7 @@ WorkChains support the use of logical constructs such as `If_` and `While_` to c A `Controller` can control processes throughout their lifetime, by sending and receiving messages. It can launch, pause, continue, kill and check status of the process. -The {py:class}`~plumpy.process_comms.RemoteProcessThreadController` can communicate with the process over the thread communicator provided by {{kiwipy}} which can subscribe and send messages over the {{rabbitmq}} message broker. +The {py:class}`~plumpy.rmq.process_control.RemoteProcessThreadController` can communicate with the process over the thread communicator provided by {{kiwipy}} which can subscribe and send messages over the {{rabbitmq}} message broker. The thread communicator runs on a independent thread (event loop) and so will not be blocked by sometimes long waiting times in the process event loop. Using RabbitMQ means that even if the computer is terminated unexpectedly, messages are persisted and can be run once the computer restarts. diff --git a/docs/source/tutorial.ipynb b/docs/source/tutorial.ipynb index b544d38b..ba0dd8ca 100644 --- a/docs/source/tutorial.ipynb +++ b/docs/source/tutorial.ipynb @@ -66,7 +66,7 @@ "The {py:class}`~plumpy.workchains.WorkChain`\n", ": A subclass of `Process` that allows for running a process as a set of discrete steps (also known as instructions), with the ability to save the state of the process after each instruction has completed.\n", "\n", - "The process `Controller` (principally the {py:class}`~plumpy.process_comms.RemoteProcessThreadController`)\n", + "The process `Controller` (principally the {py:class}`~plumpy.rmq.process_control.RemoteProcessThreadController`)\n", ": To control the process or workchain throughout its lifetime." ] }, diff --git a/src/plumpy/rmq/__init__.py b/src/plumpy/rmq/__init__.py index ca14e02e..fbb9f243 100644 --- a/src/plumpy/rmq/__init__.py +++ b/src/plumpy/rmq/__init__.py @@ -3,6 +3,6 @@ from .communications import * from .exceptions import * from .futures import * -from .process_comms import * +from .process_control import * -__all__ = exceptions.__all__ + communications.__all__ + futures.__all__ + process_comms.__all__ +__all__ = exceptions.__all__ + communications.__all__ + futures.__all__ + process_control.__all__ diff --git a/src/plumpy/rmq/process_comms.py b/src/plumpy/rmq/process_control.py similarity index 100% rename from src/plumpy/rmq/process_comms.py rename to src/plumpy/rmq/process_control.py diff --git a/tests/rmq/test_communicator.py b/tests/rmq/test_communicator.py index ef336293..9ec0a33e 100644 --- a/tests/rmq/test_communicator.py +++ b/tests/rmq/test_communicator.py @@ -14,7 +14,7 @@ from kiwipy import rmq import plumpy -from plumpy.rmq import communications, process_comms +from plumpy.rmq import communications, process_control from .. import utils @@ -55,7 +55,7 @@ def loop_communicator(): @pytest.fixture def async_controller(loop_communicator: communications.LoopCommunicator): - yield process_comms.RemoteProcessController(loop_communicator) + yield process_control.RemoteProcessController(loop_communicator) class TestLoopCommunicator: diff --git a/tests/rmq/test_process_comms.py b/tests/rmq/test_process_control.py similarity index 97% rename from tests/rmq/test_process_comms.py rename to tests/rmq/test_process_control.py index 18abcacf..549ef9c6 100644 --- a/tests/rmq/test_process_comms.py +++ b/tests/rmq/test_process_control.py @@ -8,7 +8,7 @@ from kiwipy import rmq import plumpy -from plumpy.rmq import process_comms +from plumpy.rmq import process_control from .. import utils @@ -79,12 +79,12 @@ def _coordinator(): @pytest.fixture def async_controller(_coordinator): - yield process_comms.RemoteProcessController(_coordinator) + yield process_control.RemoteProcessController(_coordinator) @pytest.fixture def sync_controller(_coordinator): - yield process_comms.RemoteProcessThreadController(_coordinator) + yield process_control.RemoteProcessThreadController(_coordinator) class TestRemoteProcessController: @@ -240,7 +240,7 @@ async def test_kill_all(self, _coordinator, sync_controller): for _ in range(10): procs.append(utils.WaitForSignalProcess(coordinator=_coordinator)) - msg = process_comms.MessageBuilder.kill(text='bang bang, I shot you down') + msg = process_control.MessageBuilder.kill(text='bang bang, I shot you down') sync_controller.kill_all(msg) await utils.wait_util(lambda: all([proc.killed() for proc in procs]))