Documentation
¶
Index ¶
- type MemoryRealtimeBus
- func (b *MemoryRealtimeBus) Close() error
- func (b *MemoryRealtimeBus) Publish(_ context.Context, topic string, payload []byte) error
- func (b *MemoryRealtimeBus) Subscribe(ctx context.Context, topic string) (<-chan []byte, error)
- func (b *MemoryRealtimeBus) SubscribeReplay(ctx context.Context, topic string, _ interfaces.ReplayPolicy) (<-chan []byte, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type MemoryRealtimeBus ¶
type MemoryRealtimeBus struct {
// contains filtered or unexported fields
}
MemoryRealtimeBus is an in-process fan-out bus. Every subscriber to a topic receives a copy of every published message. It is single-node only and non-durable, which is exactly the right model for low-latency GraphQL subscriptions on a single engine instance.
func GetMemoryRealtimeBus ¶
func GetMemoryRealtimeBus(_ *models.Config) (*MemoryRealtimeBus, error)
GetMemoryRealtimeBus returns an in-process realtime bus.
func (*MemoryRealtimeBus) Close ¶
func (b *MemoryRealtimeBus) Close() error
Close marks the bus closed; subscriber channels close via their ctx.
func (*MemoryRealtimeBus) Publish ¶
Publish delivers payload to every active subscriber of topic (non-blocking).
func (*MemoryRealtimeBus) Subscribe ¶
Subscribe registers a new subscriber channel for topic and removes it when ctx is cancelled.
func (*MemoryRealtimeBus) SubscribeReplay ¶
func (b *MemoryRealtimeBus) SubscribeReplay(ctx context.Context, topic string, _ interfaces.ReplayPolicy) (<-chan []byte, error)
SubscribeReplay on the memory bus is a no-op alias of Subscribe (no durability).