StreamManagerV2
StreamManagerV2 provides an event-based architecture for managing gRPC streams with automatic retry, exponential backoff, and comprehensive error handling.Key Features
- Event-based lifecycle - Listen to connect, disconnect, error, and data events
- Automatic retry - Configurable exponential backoff with retry limits
- Error handling - Distinguishes retryable vs non-retryable errors
- Persistent mode - Continue retrying indefinitely after max attempts
- Fine-grained control - Start, stop, and manage stream lifecycle
Basic Usage
Available Stream Classes
IndexerGrpcAccountStreamV2- Account balance and transaction streamsIndexerGrpcAccountPortfolioStreamV2- Portfolio value streamsIndexerGrpcArchiverStreamV2- Archiver data streamsIndexerGrpcAuctionStreamV2- Auction bid streamsIndexerGrpcDerivativesStreamV2- Derivatives market streamsIndexerGrpcExplorerStreamV2- Blockchain explorer streamsIndexerGrpcMitoStreamV2- Mito vault streamsIndexerGrpcOracleStreamV2- Oracle price feed streamsIndexerGrpcSpotStreamV2- Spot market streamsIndexerGrpcTradingStreamV2- Trading automation streams
Retry Configuration
Event Types
connect- Stream successfully connecteddisconnect- Stream disconnected with reasonerror- Stream error occurreddata- New data receivedstateChange- Stream state changedretry- Retry attempt startedwarn- Warning message
Stream Examples
- Account - Stream account updates
- Archiver - Stream archiver data
- Auction - Stream auction updates
- Derivatives - Stream derivatives market updates
- Explorer - Stream explorer updates
- Mito - Stream Mito vault updates
- Oracle - Stream oracle price updates
- Portfolio - Stream portfolio updates
- Spot - Stream spot market updates
- Trading - Stream trading automation updates
