Documentation
¶
Index ¶
Constants ¶
View Source
const Name = "memory"
Name is the stable identifier used in routing configuration.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct {
// QueueSize is the per-subscription channel capacity. Defaults
// to 1024 when zero or negative.
QueueSize int
// FullPolicy controls the action when QueueSize is reached.
// Defaults to FullPolicyError when empty.
FullPolicy FullPolicy
// PublishTimeout caps Publish in the block-policy case. Zero
// means no timeout.
PublishTimeout time.Duration
}
Config configures a memory Transport instance.
func (Config) EffectiveFullPolicy ¶
func (c Config) EffectiveFullPolicy() FullPolicy
EffectiveFullPolicy applies the default when FullPolicy is unset.
func (Config) EffectiveQueueSize ¶
EffectiveQueueSize applies the default when QueueSize is unset.
type FullPolicy ¶
type FullPolicy string
FullPolicy controls what happens when a subscription queue is full.
const ( // FullPolicyError rejects new publishes with ErrQueueFull. The // caller decides whether to retry or fail the upstream operation. // This is the default — it makes back-pressure explicit. FullPolicyError FullPolicy = "error" // FullPolicyBlock blocks the publisher until the queue drains. // Use only when the publisher can tolerate latency spikes. FullPolicyBlock FullPolicy = "block" // FullPolicyDropOldest evicts the oldest pending frame to make // room for the new one. Use for throwaway telemetry where loss // is preferable to either error or blocking. FullPolicyDropOldest FullPolicy = "drop_oldest" )
Click to show internal directories.
Click to hide internal directories.