Skip to main content

Rdb

Remote debugger.

Attributes​

AttributeTypeDescription
mestring = Remote DebuggerDisplay label used to identify the debugger instance in logs and banners.
do_ccallable = do_continueAlias for the continue command which closes the remote session and resumes program execution.
do_qcallable = do_quitAlias for the quit command which closes the remote session and terminates the debugger.

Constructor​

Signature​

def Rdb(
host: string = CELERY_RDB_HOST,
port: int = CELERY_RDB_PORT,
port_search_limit: int = 100,
port_skew: int = 0,
out: file-like object = sys.stdout
)

Parameters​

NameTypeDescription
hoststring = CELERY_RDB_HOSTThe hostname or IP address to bind the debugger to.
portint = CELERY_RDB_PORTThe base port number to start searching for an available port.
port_search_limitint = 100The maximum number of ports to check if the initial port is unavailable.
port_skewint = 0An offset added to the base port number.
outfile-like object = sys.stdoutThe output stream used for local status messages.

Methods​


get_avail_port()​

@classmethod
def get_avail_port(
host: string,
port: integer,
search_limit: integer = 100,
skew: integer = +0
) - > tuple

Attempts to find and bind to an available TCP port within a specified range, accounting for process skew.

Parameters​

NameTypeDescription
hoststringThe hostname or IP address to bind the listening socket to
portintegerThe base port number to start searching from
search_limitinteger = 100The maximum number of consecutive ports to check before failing
skewinteger = +0An offset added to the base port, often derived from the current process name to avoid collisions

Returns​

TypeDescription
tupleA tuple containing the bound socket object and the integer port number that was successfully acquired

say()​

@classmethod
def say(
m: string
) - > null

Writes a message to the local output stream, typically used for logging connection status and banners.

Parameters​

NameTypeDescription
mstringThe message string to be printed to the output stream

Returns​

TypeDescription
null

do_continue()​

@classmethod
def do_continue(
arg: string
) - > integer

Closes the remote session and resumes program execution.

Parameters​

NameTypeDescription
argstringOptional arguments passed from the debugger command line

Returns​

TypeDescription
integerReturns 1 to signal the debugger loop to stop and continue execution

do_quit()​

@classmethod
def do_quit(
arg: string
) - > integer

Closes the remote session and terminates the debugger.

Parameters​

NameTypeDescription
argstringOptional arguments passed from the debugger command line

Returns​

TypeDescription
integerReturns 1 to signal the debugger loop to stop

set_quit()​

@classmethod
def set_quit() - > null

Disables the system trace function to stop debugging, which may trigger a BdbQuit exception.

Returns​

TypeDescription
null