PartitionHandlerManager
Class in @sentio/sdk
Defined in @sentio/sdk
Generic manager for handling partition logic across all chain plugins. Provides a unified interface for registering, storing, and processing partition handlers. Chain-specific logic should remain in individual plugins.
Constructors
Constructor
new PartitionHandlerManager(): PartitionHandlerManager;Returns
PartitionHandlerManager
Methods
clear()
clear(): void;Clear all partition handlers (useful for testing or reinitialization)
Returns
void
getHandlerCount()
getHandlerCount(handlerType: HandlerType): number;Get the number of registered handlers for a specific handler type
Parameters
| Parameter | Type | Description |
|---|---|---|
handlerType | HandlerType | The handler type to check |
Returns
number
Number of registered handlers for this type
getRegisteredHandlerTypes()
getRegisteredHandlerTypes(): HandlerType[];Get all registered handler types
Returns
Array of handler types that have registered partition handlers
processPartitionForHandlerType()
processPartitionForHandlerType(
handlerType: HandlerType,
handlerIds: number[],
data: any
): Promise<Record<number, ProcessStreamResponse_Partitions_Partition>>;Process partition logic for a specific handler type
Parameters
| Parameter | Type | Description |
|---|---|---|
handlerType | HandlerType | The type of handler being processed |
handlerIds | number[] | Array of handler IDs to process |
data | any | The data to pass to partition handlers |
Returns
Promise<Record<number, ProcessStreamResponse_Partitions_Partition>>
Record mapping handler IDs to partition results
registerPartitionHandler()
registerPartitionHandler(
handlerType: HandlerType,
handlerId: number,
partitionHandler?: PartitionHandlerFunction
): void;Register a partition handler for a specific handler type and ID
Parameters
| Parameter | Type | Description |
|---|---|---|
handlerType | HandlerType | The type of handler (e.g., HandlerType.ETH_LOG, HandlerType.APT_EVENT) |
handlerId | number | The unique ID for this handler instance |
partitionHandler? | PartitionHandlerFunction | The partition handler function (optional) |
Returns
void