whylogs.api.logger.experimental.logger.actor.process_actor
#
Module Contents#
Classes#
Generic enumeration. |
|
Subclass of Actor that uses a process to process messages. |
Attributes#
- whylogs.api.logger.experimental.logger.actor.process_actor.StatusType#
- whylogs.api.logger.experimental.logger.actor.process_actor.ProcessMessageType#
- class whylogs.api.logger.experimental.logger.actor.process_actor.QueueType#
Bases:
enum.Enum
Generic enumeration.
Derive from this class to define new enumerations.
- MP = 'MP'#
- FASTER_FIFO = 'FASTER_FIFO'#
- name()#
The name of the Enum member.
- value()#
The value of the Enum member.
- class whylogs.api.logger.experimental.logger.actor.process_actor.ProcessActor(queue_config: whylogs.api.logger.experimental.logger.actor.actor.QueueConfig = QueueConfig(), queue_type: QueueType = QueueType.FASTER_FIFO, sync_enabled: bool = False)#
Bases:
whylogs.api.logger.experimental.logger.actor.actor.Actor
[Union
[ProcessMessageType
,whylogs.api.logger.experimental.logger.actor.process_rolling_logger_messages.ProcessStatusMessage
]],multiprocessing.Process
,Generic
[ProcessMessageType
,StatusType
]Subclass of Actor that uses a process to process messages.
- Parameters
queue_config (whylogs.api.logger.experimental.logger.actor.actor.QueueConfig) –
queue_type (QueueType) –
sync_enabled (bool) –
- property name#
- property daemon#
Return whether process is a daemon
- property authkey#
- property exitcode#
Return exit code of process or None if it has yet to stop
- property ident#
Return identifier (PID) of process or None if it has yet to start
- property sentinel#
Return a file descriptor (Unix) or handle (Windows) suitable for waiting for process termination.
- pid#
- close() None #
Close the Process object.
This method releases resources held by the Process object. It is an error to call this method if the child process is still running.
- Return type
- status(timeout: Optional[float] = 1.0) StatusType #
Get the internal status of the Process Actor. Used for diagnostics and debugging. This is always synchronous and requires the ProcessActor to be created with sync_enabled=True.
- Parameters
timeout (Optional[float]) –
- Return type
StatusType
- start() None #
The process version of the actor apparently has to be manually started after it’s created, unlike the thread version which can just be automatically started from within its init. There must be some post-init setup that needs to be done.
- Return type
- terminate()#
Terminate process; sends SIGTERM signal or uses TerminateProcess()
- kill()#
Terminate process; sends SIGKILL signal or uses TerminateProcess()
- join(timeout=None)#
Wait until child process terminates
- is_alive()#
Return whether process is alive