Source code for aiida.brokers.broker

"""Interface for a message broker that facilitates communication with and between process runners."""

import abc
import typing as t

if t.TYPE_CHECKING:
    from aiida.manage.configuration.profile import Profile

__all__ = ('Broker',)


[docs] class Broker: """Interface for a message broker that facilitates communication with and between process runners."""
[docs] def __init__(self, profile: 'Profile') -> None: """Construct a new instance. :param profile: The profile. """ self._profile = profile
[docs] @abc.abstractmethod def get_communicator(self): """Return an instance of :class:`kiwipy.Communicator`."""
[docs] @abc.abstractmethod def iterate_tasks(self): """Return an iterator over the tasks in the launch queue."""
[docs] @abc.abstractmethod def close(self): """Close the broker."""