StatusWatcher

class supriya.tools.servertools.StatusWatcher(server)[source]

Lineage

digraph InheritanceGraph { graph [background=transparent, bgcolor=transparent, color=lightslategrey, fontname=Arial, outputorder=edgesfirst, overlap=prism, penwidth=2, rankdir=LR, root="__builtin__.object", splines=spline, style="dotted, rounded", truecolor=true]; node [colorscheme=pastel19, fontname=Arial, fontsize=12, penwidth=2, style="filled, rounded"]; edge [color=lightsteelblue2, penwidth=2]; subgraph cluster_builtins { graph [label=builtins]; "builtins.object" [color=1, group=0, label=object, shape=box]; } subgraph cluster_servertools { graph [label=servertools]; "supriya.tools.servertools.StatusWatcher.StatusWatcher" [color=black, fontcolor=white, group=1, label=<<B>StatusWatcher</B>>, shape=box, style="filled, rounded"]; } subgraph cluster_threading { graph [label=threading]; "threading.Thread" [color=3, group=2, label=Thread, shape=box]; } "builtins.object" -> "threading.Thread"; "threading.Thread" -> "supriya.tools.servertools.StatusWatcher.StatusWatcher"; }

Bases

Attribute summary

active
attempts
daemon A boolean value indicating whether this thread is a daemon thread.
getName()
ident Thread identifier of this thread or None if it has not been started.
isAlive() Return whether the thread is alive.
isDaemon()
is_alive() Return whether the thread is alive.
join([timeout]) Wait until the thread terminates.
name A string used for identification purposes only.
response_callback
run()
server
setDaemon(daemonic)
setName(name)
start() Start the thread’s activity.
__call__(response)
__repr__()

Read-only properties

StatusWatcher.attempts
(Thread).ident

Thread identifier of this thread or None if it has not been started.

This is a nonzero integer. See the thread.get_ident() function. Thread identifiers may be recycled when a thread exits and another thread is created. The identifier is available even after the thread has exited.

StatusWatcher.response_callback
StatusWatcher.server

Read/write properties

StatusWatcher.active
(Thread).daemon

A boolean value indicating whether this thread is a daemon thread.

This must be set before start() is called, otherwise RuntimeError is raised. Its initial value is inherited from the creating thread; the main thread is not a daemon thread and therefore all threads created in the main thread default to daemon = False.

The entire Python program exits when no alive non-daemon threads are left.

(Thread).name

A string used for identification purposes only.

It has no semantics. Multiple threads may be given the same name. The initial name is set by the constructor.

Methods

(Thread).getName()
(Thread).isAlive()

Return whether the thread is alive.

This method returns True just before the run() method starts until just after the run() method terminates. The module function enumerate() returns a list of all alive threads.

(Thread).isDaemon()
(Thread).is_alive()

Return whether the thread is alive.

This method returns True just before the run() method starts until just after the run() method terminates. The module function enumerate() returns a list of all alive threads.

(Thread).join(timeout=None)

Wait until the thread terminates.

This blocks the calling thread until the thread whose join() method is called terminates – either normally or through an unhandled exception or until the optional timeout occurs.

When the timeout argument is present and not None, it should be a floating point number specifying a timeout for the operation in seconds (or fractions thereof). As join() always returns None, you must call isAlive() after join() to decide whether a timeout happened – if the thread is still alive, the join() call timed out.

When the timeout argument is not present or None, the operation will block until the thread terminates.

A thread can be join()ed many times.

join() raises a RuntimeError if an attempt is made to join the current thread as that would cause a deadlock. It is also an error to join() a thread before it has been started and attempts to do so raises the same exception.

StatusWatcher.run()[source]
(Thread).setDaemon(daemonic)
(Thread).setName(name)
(Thread).start()

Start the thread’s activity.

It must be called at most once per thread object. It arranges for the object’s run() method to be invoked in a separate thread of control.

This method will raise a RuntimeError if called more than once on the same thread object.

Special methods

StatusWatcher.__call__(response)[source]
(Thread).__repr__()