streaming

package
v0.3.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 3, 2025 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ConsumerGroup added in v0.3.0

type ConsumerGroup struct {
	// contains filtered or unexported fields
}

ConsumerGroup is a robust Redis stream consumer using consumer groups

func NewConsumerGroup added in v0.3.0

func NewConsumerGroup(config ConsumerGroupConfig, server *mcp.Server, engine *learning.Engine) (*ConsumerGroup, error)

NewConsumerGroup creates a new consumer group based stream consumer

func (*ConsumerGroup) GetConsumerInfo added in v0.3.0

func (cg *ConsumerGroup) GetConsumerInfo(ctx context.Context) (map[string]interface{}, error)

GetConsumerInfo returns information about this consumer's pending messages

func (*ConsumerGroup) PublishEvent added in v0.3.0

func (cg *ConsumerGroup) PublishEvent(ctx context.Context, eventType string, data map[string]interface{}) error

PublishEvent publishes an event to the stream

func (*ConsumerGroup) Start added in v0.3.0

func (cg *ConsumerGroup) Start(ctx context.Context) error

Start begins consuming from the stream using consumer groups

func (*ConsumerGroup) Stop added in v0.3.0

func (cg *ConsumerGroup) Stop()

Stop gracefully stops the consumer

type ConsumerGroupConfig added in v0.3.0

type ConsumerGroupConfig struct {
	RedisAddr     string
	StreamKey     string
	GroupName     string
	ConsumerName  string
	BatchSize     int64
	BlockDuration time.Duration
	ClaimMinIdle  time.Duration // How long before we can claim abandoned messages
}

ConsumerGroupConfig holds configuration for the consumer group

type StreamConsumer

type StreamConsumer struct {
	// contains filtered or unexported fields
}

StreamConsumer listens to Redis streams and forwards events to the learning Engine

func NewStreamConsumer

func NewStreamConsumer(redisAddr string, server *mcp.Server, engine *learning.Engine) (*StreamConsumer, error)

NewStreamConsumer creates a new stream consumer that delegates to learning Engine

func (*StreamConsumer) PublishEvent

func (sc *StreamConsumer) PublishEvent(ctx context.Context, eventType string, data map[string]interface{}) error

PublishEvent publishes a tool event to the stream (for other components to use)

func (*StreamConsumer) Start

func (sc *StreamConsumer) Start(ctx context.Context) error

Start begins consuming the stream

func (*StreamConsumer) Stop

func (sc *StreamConsumer) Stop()

Stop gracefully stops the consumer

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL