Skip to main content
Context manager for managing the StashClient lifecycle.

StashContext

Context manager for Stash client. This class provides a high-level interface for managing Stash client connections, including: - Connection configuration - Client lifecycle management - Interface access - Reference counting for safe concurrent usage
Example
Initialize context. Parameters:

Attributes

conn

verify_ssl

interface

Get Stash interface (alias for client). Returns: Raises:

client

Get client instance. Returns: Raises:

store

Get entity store instance. Returns: Raises:

capabilities

Get detected server capabilities. Returns: Raises:

ref_count

Get current reference count. Returns:

Functions

get_client

Get initialized Stash client. Returns: Raises:

close

Close client connection. Parameters:
When using the singleton context with async context managers, manual close() is not needed - reference counting handles cleanup. Only call manually when you created the context directly and are done with it.