-
Notifications
You must be signed in to change notification settings - Fork 198
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
work on pluggable API for worker-side monitoring radio
patch so far is overloading self.monitoring_radio for two different uses that should be clarified: submit side radio and worker side radio its a bit complicated for having a default radio (UDPRadio or HTEXRadio) even when monitoring is turned off: I should check that the radio receiver does not get activated in this case: for example: * test that broken radio activation causes a startup error * test that configuration with broken radio doesn't cause a startup error when monitoringhub is not configured zmq radio should always listen, and be the place where all radio receivers send their data. udp radio and filesystem radio should turn into separate... something... processes? for prototyping i guess it doesn't matter where I make them live, but the most behaviour preserving would keep them somehow separated?
- Loading branch information
1 parent
64987ea
commit d175376
Showing
16 changed files
with
331 additions
and
143 deletions.
There are no files selected for viewing
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
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
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
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
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
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,34 @@ | ||
import logging | ||
from abc import ABCMeta, abstractmethod | ||
from typing import Optional | ||
from multiprocessing.queues import Queue | ||
from typing import Any | ||
|
||
_db_manager_excepts: Optional[Exception] | ||
|
||
logger = logging.getLogger(__name__) | ||
class MonitoringRadioReceiver(metaclass=ABCMeta): | ||
@abstractmethod | ||
def shutdown(self) -> None: | ||
pass | ||
|
||
|
||
class MonitoringRadioSender(metaclass=ABCMeta): | ||
@abstractmethod | ||
def send(self, message: object) -> None: | ||
pass | ||
|
||
|
||
class RadioConfig(metaclass=ABCMeta): | ||
"""Base class for radio plugin configuration. | ||
""" | ||
@abstractmethod | ||
def create_sender(self) -> MonitoringRadioSender: | ||
pass | ||
|
||
@abstractmethod | ||
def create_receiver(self, *, ip: str, run_dir: str, resource_msgs: Queue) -> Any: | ||
# TODO: return a shutdownable, and probably take some context to help in | ||
# creation of the radio config? esp. the ZMQ endpoint to send messages to | ||
# from the receiving process that might be created? | ||
"""create a receiver for this config, and update this config as | ||
appropriate so that create_sender will be able to connect back to that | ||
receiver in whichever way is relevant. create_sender can assume | ||
that create_receiver has been called.""" | ||
pass |
Oops, something went wrong.