Documentation
¶
Overview ¶
Package outbox persists outgoing stream requests that failed because the destination node was offline and replays them, oldest-first, once that node is seen online again (via the pubsub discovery signal) or on startup.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type RetryService ¶
type RetryService struct {
// contains filtered or unexported fields
}
func NewRetryService ¶
func NewRetryService(ctx context.Context, repo Repo) *RetryService
func (*RetryService) Close ¶
func (s *RetryService) Close()
func (*RetryService) Enqueue ¶
func (s *RetryService) Enqueue(destNodeId, route string, payload []byte) error
Enqueue stores an undelivered request and marks its destination pending so a later NotifyOnline flushes it.
func (*RetryService) FlushAllOnStart ¶
func (s *RetryService) FlushAllOnStart()
FlushAllOnStart schedules a one-shot replay of every node that still has queued entries, covering the case where a peer is already online at startup and won't re-announce for a while.
func (*RetryService) NotifyOnline ¶
func (s *RetryService) NotifyOnline(nodeId string)
NotifyOnline is the pubsub-discovery hook: it is called for every peer seen on the discovery topic. It is O(1) and does no I/O when the node has nothing queued, so it is cheap to call on every gossip announcement.
func (*RetryService) SetSender ¶
func (s *RetryService) SetSender(sender Sender)
SetSender wires the redelivery transport. Until it is set, flushes are no-ops, so it is safe to construct the service before the node is up.