whylogs.api.logger.experimental.logger.actor.process_actor#

Module Contents#

Classes#

QueueType

Generic enumeration.

ProcessActor

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
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_message_handled() bool#
Return type

bool

set_close_message_handled() None#
Return type

None

close_message_wait() None#
Return type

None

is_done() bool#
Return type

bool

done_wait() None#
Return type

None

set_done() None#
Return type

None

set_closed() None#
Return type

None

is_closed() bool#
Return type

bool

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

None

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

run() None#

Method to be run in sub-process; can be overridden in sub-class

Return type

None

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

None

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