class documentation

class FilterContext:

Constructor: FilterContext(filter_registry)

View In Hierarchy

Context for managing stateful filter resources.

This class manages the runtime state for filters, including: - Cached filter driver instances that maintain long-running state - Resource lifecycle management

It works in conjunction with FilterRegistry to provide complete filter functionality while maintaining proper separation of concerns.

Method __del__ Clean up on destruction.
Method __init__ Initialize FilterContext.
Method close Close all active filter resources.
Method get_driver Get a filter driver by name, managing stateful instances.
Method refresh_config Refresh the configuration used by the filter registry.
Instance Variable filter_registry Undocumented
Instance Variable _active_drivers Undocumented
def __del__(self):

Clean up on destruction.

def __init__(self, filter_registry: FilterRegistry):

Initialize FilterContext.

Parameters
filter_registry:FilterRegistryThe filter registry to use for driver lookups
def close(self):

Close all active filter resources.

def get_driver(self, name: str) -> FilterDriver | None:

Get a filter driver by name, managing stateful instances.

This method handles driver instantiation and caching. Only drivers that should be reused are cached.

Parameters
name:strThe filter name
Returns
FilterDriver | NoneFilterDriver instance or None
def refresh_config(self, config: StackedConfig):

Refresh the configuration used by the filter registry.

This should be called when the configuration has changed to ensure filters use the latest settings.

Parameters
config:StackedConfigThe new configuration stack
filter_registry =

Undocumented

_active_drivers: dict[str, FilterDriver] =

Undocumented