Documentation
¶
Overview ¶
Package redisstream provides a Redis Streams adapter for runtime/contracts.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Decoder ¶
type Decoder func(json.RawMessage) (any, error)
Decoder converts one JSON event value into the typed value expected by runtime/contracts subscribers.
type Option ¶
type Option func(*Store)
Option configures a Store.
func WithBatchSize ¶
WithBatchSize sets the max stream messages returned per receive call.
func WithDecoder ¶
WithDecoder registers a decoder for one event type.
func WithJSONDecoder ¶
WithJSONDecoder registers a JSON decoder for one event type.
type Store ¶
type Store struct {
// contains filtered or unexported fields
}
Store publishes events to a Redis stream and reads them through a consumer group. It implements contracts.Broker and contracts.EventSource.
func (*Store) EnsureGroup ¶
EnsureGroup creates the consumer group if it does not already exist.
func (*Store) PublishEvents ¶
PublishEvents appends event envelopes to the Redis stream.
func (*Store) ReceiveEventBatch ¶
ReceiveEventBatch reads the next stream batch for this consumer.