HandlerInterface
Abstract Classapplication_sdk.interfaces.handlerAbstract base class defining the contract that all handlers must fulfill. Ensures a consistent interface for the Application and Activities to interact with any handler, regardless of the underlying system. Handlers serve as the core implementation layer for a connector, containing system-specific interaction logic, client management, API implementation, and activity logic delegation.
Methods4
load
async load(self, *args, **kwargs) -> NoneParameters
argstuplekwargsdictReturns
None - No return valueImplementation Details
Typically loads the associated ClientInterface with credentials passed via kwargs
test_auth
async test_auth(self, *args, **kwargs) -> boolParameters
argstuplekwargsdictReturns
bool - True if authentication succeeds, False if it failspreflight_check
async preflight_check(self, *args, **kwargs) -> dictParameters
argstuplekwargsdictReturns
dict - Dictionary summarizing check results with success status and detailsImplementation Details
Often includes verifying connectivity, checking permissions, validating configuration, or checking for required resources
fetch_metadata
async fetch_metadata(self, *args, **kwargs) -> AnyParameters
argstuplekwargsdictReturns
Any - Fetched metadata, often as a list of dictionariesImplementation Details
The specific type and format of metadata depend on the implementation and the arguments passed
Usage Examples
Application Integration
Handler instance is passed to APIServer constructor
app = APIServer(handler=MyConnectorHandler())
Activity Usage
Activities access handler through ActivitiesState
state = await self._get_state(...)
await state.handler.test_auth(**credentials)
metadata = await state.handler.fetch_metadata(**filters)