pyrolab.manager.NameServerRunner#
- class NameServerRunner(*args, name: str = '', nsconfig: NameServerConfiguration = None, msg_queue: Queue = None, msg_polling: float = 1.0, **kwargs)[source]#
Bases:
ProcessA process for running nameservers using Python’s
multiprocessing.Advantages of using a child Process include the fact that if a server dies or hangs up, the entire program doesn’t stall or need to be restarted, just the process that contained the server. Thus errors can be handled and servers autonomously restarted and managed.
- Parameters:
- namestr
The name of the nameserver being run.
- nsconfigNameServerConfiguration
The configuration for the nameserver.
- msg_queuemultiprocessing.Queue
A message queue. ResourceRunner listens for when
Noneis placed in the queue, which is a sentinel value to shutdown the process.- msg_pollingfloat, optional
The time in seconds between polling the message queue.
- Attributes:
- authkey
daemonReturn whether process is a daemon
exitcodeReturn exit code of process or None if it has yet to stop
identReturn identifier (PID) of process or None if it has yet to start
- name
pidReturn identifier (PID) of process or None if it has yet to start
sentinelReturn a file descriptor (Unix) or handle (Windows) suitable for waiting for process termination.
Methods
close()Close the Process object.
is_alive()Return whether process is alive
join([timeout])Wait until child process terminates
kill()Terminate process; sends SIGKILL signal or uses TerminateProcess()
A message handler.
run()Creates and runs the child process.
start()Start child process
A callback listener; if the sentinel value
Noneis placed in the message queue, returns True signifying a shutdown signal has been received.Terminate process; sends SIGTERM signal or uses TerminateProcess()