Skip to main content

Module streaming

Module streaming 

Source
Expand description

Streaming integrations (Kafka, Redis Streams, NATS). Streaming Integrations — FR-011

External event stream consumption bridges for Kafka, Redis Streams, and NATS. Each provider implements the StreamConsumer trait, which bridges external events into K2K messages for GPU actor processing.

§Architecture

External Stream          Bridge              GPU Actors
┌─────────────┐   ┌──────────────┐   ┌──────────────────┐
│ Kafka Topic │──►│ KafkaConsumer│──►│ K2K → Actor Queue │
│ Redis XREAD │──►│ RedisConsumer│──►│ K2K → Actor Queue │
│ NATS Subject│──►│ NatsConsumer │──►│ K2K → Actor Queue │
└─────────────┘   └──────────────┘   └──────────────────┘
                  Backpressure: pause consumption when actors overloaded

Structs§

InMemoryConsumer
In-memory stream consumer for testing the bridge without external dependencies.
KafkaConfig
Kafka consumer configuration.
NatsConfig
NATS consumer configuration.
RedisStreamConfig
Redis Streams consumer configuration.
StreamConsumerConfig
Configuration for a stream consumer.
StreamConsumerMetrics
Metrics for a stream consumer.
StreamMessage
A message consumed from an external stream.

Enums§

CommitStrategy
When to commit offsets.
StreamError
Errors from stream operations.
StreamOffset
Offset within a stream (provider-specific).

Traits§

StreamConsumer
Trait for stream consumer implementations.