Documentation
¶
Index ¶
Constants ¶
View Source
const Channel = "ploykit:relay:v1"
View Source
const MaxHops = 4
MaxHops bounds the relay chain: the origin-drop check protects against hearing your own broadcast, but a consumer misusing Broadcast as a point-to-point deliver (orkome field report) loops the frame between ≥2 replicas exponentially — the hop cap turns that into a bounded fan with a WARN naming the frame instead of silent CPU burn. 4 comfortably exceeds any sane fan-out topology.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Envelope ¶
type Envelope struct {
Origin string `json:"origin"`
Scope string `json:"scope"`
Frame wswire.Frame `json:"frame"`
// Hops counts how many instances have relayed this envelope. Every hop
// that forwards (rather than terminating) the frame must increment it
// before re-publishing; Run drops frames whose Hops reached MaxHops.
Hops int `json:"hops,omitempty"`
}
type MemoryTransport ¶
type MemoryTransport struct {
// contains filtered or unexported fields
}
func NewMemoryTransport ¶
func NewMemoryTransport() *MemoryTransport
type RedisTransport ¶
type RedisTransport struct {
// contains filtered or unexported fields
}
type Relay ¶
type Relay struct {
// contains filtered or unexported fields
}
func (*Relay) Forward ¶ added in v0.5.0
Forward re-publishes a received envelope to the other instances (the hop that keeps the chain going). Run's deliver callback handles the local delivery; Forward is the only sanctioned way to keep it traveling, and it refuses frames at the hop cap.
func (*Relay) PublishOut ¶
Click to show internal directories.
Click to hide internal directories.