class pxblat.ClientThread(threading.Thread)[source]

A class for managing client connections to a server in a separate thread.

This class can be used to query a gfServer in a separate thread, and can optionally wait until the server is ready before sending a query. It can also parse the result of the query.

option

Client options for the connection.

Type:

ClientOption

host

The hostname or IP address of the server. Defaults to None.

Type:

str, optional

port

The port number of the server. Defaults to None.

Type:

int, optional

wait_ready

Whether to wait until the server is ready before sending a query. Defaults to False.

Type:

bool, optional

wait_timeout

The number of seconds to wait for the server to be ready. Defaults to 60.

Type:

int, optional

server_option

The server options to use if a server is not provided. Defaults to None.

Type:

ServerOption, optional

seqname

The sequence name to use for the query. Defaults to None.

Type:

str, optional

parse

Whether to parse the result of the query. Defaults to True.

Type:

bool, optional

daemon

Whether to run the client as a daemon process. Defaults to True.

Type:

bool, optional

result

The result of the query, or None if the query has not yet been sent or the result has not yet been received.

Constructors

ClientThread(option: ClientOption, host: str | None = None, ...)[source]

A class for querying a gfServer using a separate thread.

Public members

run()[source]

Runs the query in a separate thread.

get()[source]

Sends a query to the server and returns the result.

property host

The hostname or IP address of the server.

property port

The port number of the server.

classmethod create_option()[source]

Creates a new ClientOption object with default values.

start()

Start the thread’s activity.

join(timeout=None)

Wait until the thread terminates.

property name

A string used for identification purposes only.

property ident

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

property native_id

Native integral thread ID of this thread, or None if it has not been started.

is_alive()

Return whether the thread is alive.

property daemon

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

isDaemon()

Return whether this thread is a daemon.

setDaemon(daemonic)

Set whether this thread is a daemon.

getName()

Return a string used for identification purposes only.

setName(name)

Set the name string for this thread.

String representation

__repr__()

Return repr(self).