def __init__(self, name, actor_pusher, level_logger=logging.WARNING, timeout=None): """ :param str name: Actor name :param powerapi.PusherActor actor_pusher: Pusher actor whom send results :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.PusherActor): Pusher actor whom send results. self.actor_pusher = actor_pusher formula_id = reduce( lambda acc, x: acc + (re.search(r'^\(? ?\'(.*)\'\)?', x).group(1), ), name.split(','), ()) #: (powerapi.State): Basic state of the Formula. self.state = FormulaState(Actor._initial_behaviour, SocketInterface(name, timeout), self.logger, formula_id)
def __init__(self, name, database, report_filter, report_model, stream_mode=False, level_logger=logging.WARNING, timeout=0, timeout_puller=100): """ :param str name: Actor name. :param BaseDB database: Allow to interact with a Database. :param Filter report_filter: Filter of the Puller. :param int level_logger: Define the level of the logger :param int tiemout_puller: (require stream mode) time (in ms) between two database reading :param bool asynchrone: use asynchrone driver """ Actor.__init__(self, name, level_logger, timeout) #: (State): Actor State. self.state = PullerState(self, database, report_filter, report_model, stream_mode, timeout_puller, asynchrone=database.asynchrone) self.low_exception += database.exceptions
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(Actor._initial_behaviour, SocketInterface(name, timeout), self.logger, self._create_factory(), route_table)
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, asynchrone=database.asynchrone) self.delay = delay self.max_size = max_size
def __init__(self): Actor.__init__(self, DispatcherStartMessage) self.formula_class: Type[FormulaActor] = None self.formula_values: FormulaValues = None self.route_table: RouteTable = None self.device_id = None self._exit_mode = False self.formula_name_service = None self.formula_waiting_service = FormulaWaitingService() self.formula_pool = {} self.formula_number_id = 0
def __init__(self, name, pushers: Dict[str, PusherActor], level_logger=logging.WARNING, timeout=None): """ Initialize a new Formula actor. :param name: Actor name :param pushers: Pusher actors :param level_logger: Level of the logger :param timeout: Time in millisecond to wait for a message before calling the timeout handler """ Actor.__init__(self, name, level_logger, timeout) self.state = FormulaState(self, pushers)
def __init__(self, name, report_model, database, level_logger=logging.WARNING, timeout=1000): """ :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 """ Actor.__init__(self, name, level_logger, timeout) #: (State): State of the actor. self.state = PusherState(self, database, report_model)
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
def __init__(self, name, database, report_filter, report_model, stream_mode=False, level_logger=logging.WARNING, timeout=0, timeout_sleeping=100): """ :param str name: Actor name. :param BaseDB database: Allow to interact with a Database. :param Filter report_filter: Filter of the Puller. :param int level_logger: Define the level of the logger """ Actor.__init__(self, name, level_logger, timeout) #: (State): Actor State. self.state = PullerState(self, database, report_filter, report_model, stream_mode, timeout, timeout_sleeping)
def __init__(self, name, database, report_filter, level_logger=logging.WARNING, timeout=0, timeout_sleeping=100): """ :param str name: Actor name. :param BaseDB database: Allow to interact with a Database. :param Filter report_filter: Filter of the Puller. :param int level_logger: Define the level of the logger :param bool stream_mode: Puller stream_mode himself when it finish to read all the database. """ Actor.__init__(self, name, level_logger, timeout) #: (State): Actor State. self.state = PullerState(Actor._initial_behaviour, SocketInterface(name, timeout), self.logger, database, report_filter, timeout, timeout_sleeping)
def __init__(self, name=ACTOR_NAME): Actor.__init__(self, name, level_logger=LOG_LEVEL)
def __init__(self): Actor.__init__(self, 'test_supervisor') self.state = State(Mock()) self.send_msg = [] self.alive = False
def __init__(self): Actor.__init__(self, 'test_supervisor') self.state = State(Mock(), SocketInterface('test_supervisor', 0), Mock()) self.send_msg = [] self.alive = False
def __init__(self, name=ACTOR_NAME): Actor.__init__(self, name, level_logger=LOG_LEVEL) self.state = State(Mock(), Mock(), self.logger)
def __init__(self, start_message_cls: Type[FormulaStartMessage]): Actor.__init__(self, start_message_cls) self.pushers: Dict[str, ActorAddress] = None self.device_id = None self.sensor = None
def __init__(self): Actor.__init__(self, PusherStartMessage) self.database = None