How to use the powerapi.actor.Actor.__init__ function in powerapi

To help you get started, we’ve selected a few powerapi examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github powerapi-ng / powerapi / tests / unit / actor / test_supervisor.py View on Github external
def __init__(self):
        Actor.__init__(self, 'test_supervisor')
        self.state = State(Mock())
        self.send_msg = []
        self.alive = False
github powerapi-ng / powerapi / tests / integration / dispatcher / fake_formula.py View on Github external
def __init__(self, name, push_socket_addr, level_logger=logging.WARNING,
                 timeout=None):
        """
        :param str name: Actor name
        :param int level_logger: Define logger level
        :param bool timeout: Time in millisecond to wait for a message before
                             called timeout_handler.

        """
        Actor.__init__(self, name, level_logger, timeout)

        #: (powerapi.State): Basic state of the Formula.
        self.state = State(self)

        self.addr = push_socket_addr
        self.push_socket = None
github powerapi-ng / powerapi / tests / integration / puller / fake_dispatcher.py View on Github external
def __init__(self, name, push_socket_addr, level_logger=logging.DEBUG,
                 timeout=None):
        """
        :param str name: Actor name
        :param int level_logger: Define logger level
        :param bool timeout: Time in millisecond to wait for a message before
                             called timeout_handler.
        """
        Actor.__init__(self, name, level_logger, timeout)

        #: (powerapi.State): Basic state of the Formula.
        self.state = State(Actor._initial_behaviour,
                           SocketInterface(name, timeout),
                           self.logger)

        self.addr = push_socket_addr
        self.push_socket = None
github powerapi-ng / powerapi / tests / unit / actor / test_actor.py View on Github external
def __init__(self, name=ACTOR_NAME):
        Actor.__init__(self, name, level_logger=LOG_LEVEL)
github powerapi-ng / powerapi / powerapi / pusher / pusher_actor.py View on Github external
def __init__(self, name, report_model, database, level_logger=logging.WARNING, timeout=1000, delay=100, max_size=50):
        """
        :param str name: Pusher name.
        :param Report report_model: ReportModel
        :param BaseDB database: Database use for saving data.
        :param int level_logger: Define the level of the logger
        :param int delay: number of ms before message containing in the buffer will be writen in database
        :param int max_size: maximum of message that the buffer can store before write them in database
        """
        Actor.__init__(self, name, level_logger, timeout)

        #: (State): State of the actor.
        self.state = PusherState(self, database, report_model)
        self.delay = delay
        self.max_size = max_size
github powerapi-ng / powerapi / powerapi / dispatcher / dispatcher_actor.py View on Github external
def __init__(self, name, formula_init_function, route_table, level_logger=logging.WARNING, timeout=None):
        """
        :param str name: Actor name
        :param func formula_init_function: Function for creating Formula
        :param route_table: initialized route table of the DispatcherActor
        :type route_table: powerapi.dispatcher.state.RouteTable
        :param int level_logger: Define the level of the logger
        :param bool timeout: Define the time in millisecond to wait for a
                             message before run timeout_handler
        """
        Actor.__init__(self, name, level_logger, timeout)

        # (func): Function for creating Formula
        self.formula_init_function = formula_init_function

        # (powerapi.DispatcherState): Actor state
        self.state = DispatcherState(self, self._create_factory(), route_table)