.. _Environment: ============================= Basic Concept and Environment ============================= Overview -------- .. currentmodule:: PyroMP The basic idea is to have an application which runs several :class:`Services ` in separate threads or processes. The communication is done using :mod:`Pyro4`. The process and thread creation is provided by :mod:`multiprocessing` respectively :mod:`multiprocessing.dummy`. .. image:: images/single_application.png The prerequisite is to run a :class:`NameServer`, which manages the connection infos for all services, and a :class:`~PyroMP.log_server.LogServer` to manage :mod:`logging` across process boundaries. It is possible to access the services across application boundaries as long as one application runs the :class:`NameServer` and :class:`~PyroMP.log_server.LogServer`. .. image:: images/overview.png .. warning:: It is not possible to run more than one :class:`NameServer` or :class:`~PyroMP.log_server.LogServer` .. automodule:: PyroMP.server :noindex: .. automodule:: PyroMP.log_server :noindex: API Reference ------------- .. currentmodule:: PyroMP .. autoclass:: NameServer **Class Methods** .. automethod:: NameServer.enable .. automethod:: NameServer.disable .. automethod:: NameServer.locate .. automethod:: NameServer.start .. automethod:: NameServer.stop ------------- .. currentmodule:: PyroMP.log_server .. autofunction:: create_logger **Methods of the returned object** .. method:: Logger.add_filehandler(filename, formatter=None, level=None) Adds a :class:`logging.FileHandler` for the file with the given ``filename``. If ``formatter`` is provided the given :class:`logging.Formatter` is used. If ``level`` is provided it is forwarded to :func:`~logging.Handler.setLevel`. .. method:: Logger.add_streamhandler(stream=None, formatter=None) Adds a :class:`logging.StreamHandler` to which ``stream`` argument is forwarded. If ``formatter`` is provided the given :class:`logging.Formatter` is used. If ``level`` is provided it is forwarded to :func:`~logging.Handler.setLevel`. ------------- .. autofunction:: get_server_root_logger ------------- .. autoclass:: LogServer **Class Methods** .. automethod:: LogServer.is_running ------------- .. autofunction:: set_loglevel