View module source on GitHub

SameThreadExecutor

class SameThreadExecutor(Executor)

A mock executor that runs submitted callables on the same thread, synchronously. Mimics the interface of concurrent.futures.Executor.

get_thread_pool_executor

def get_thread_pool_executor() -> ThreadPoolExecutor

Get the global thread pool executor for processing.

shutdown_thread_pool_executor

def shutdown_thread_pool_executor(wait=True)

Shutdown the global thread pool executor.

start_new_turn

def start_new_turn(session_info: SessionStoreEntry)

This function will start a new turn and return the current turn. If the current turn is interrupted or empty, it will return None. If the current turn is not interrupted and not empty, it will return the current turn. If the current turn is interrupted and not empty, it will return None. If the current turn is empty, it will return None. If the current turn is not interrupted and empty, it will return None. If the current turn is interrupted and empty, it will return None.

Arguments:

NameDescription
session_infoThe session information.

Returns:

The new turn or None if the current turn is interrupted or empty.