Documentation
¶
Index ¶
- type ChannelBus
- func (b *ChannelBus) Close() error
- func (b *ChannelBus) Publish(ctx context.Context, topic string, event sse.Event) error
- func (b *ChannelBus) Subscribe(ctx context.Context, topic string) (<-chan sse.Event, error)
- func (b *ChannelBus) Unsubscribe(ctx context.Context, topic string, ch <-chan sse.Event) error
- type RedisBus
- func (r *RedisBus) Close() error
- func (r *RedisBus) Publish(ctx context.Context, topic string, event sse.Event) error
- func (r *RedisBus) Subscribe(ctx context.Context, topic string) (<-chan sse.Event, error)
- func (r *RedisBus) Unsubscribe(ctx context.Context, topic string, ch <-chan sse.Event) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ChannelBus ¶
type ChannelBus struct {
// contains filtered or unexported fields
}
ChannelBus implements the MessageBus interface using Go channels
func (*ChannelBus) Subscribe ¶
Subscribe returns a channel that receives events for a specific topic
func (*ChannelBus) Unsubscribe ¶
Unsubscribe removes a subscription for a specific topic
type RedisBus ¶
type RedisBus struct {
// contains filtered or unexported fields
}
RedisBus implements the MessageBus interface using Redis PubSub.
func NewRedisBus ¶
NewRedisBus creates a new Redis SSE message bus. It accepts any redis.UniversalClient (e.g., *redis.Client, *redis.ClusterClient).
func NewRedisBusWithConfig ¶
NewRedisBusWithConfig creates a new Redis SSE message bus with custom buffer size.
func (*RedisBus) Publish ¶
Publish sends a message to the specified topic. The message will be encoded as JSON before publishing.
Click to show internal directories.
Click to hide internal directories.