Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func SpawnOrConnect ¶
SpawnOrConnect ensures a daemon is running and returns the nonce for IPC auth. If no daemon is listening, it spawns one and waits for it to be ready.
Types ¶
type Keepalive ¶
type Keepalive struct {
// contains filtered or unexported fields
}
Keepalive manages per-server sliding window timers. When a server is not touched within the idle timeout, its connection is closed.
func NewKeepalive ¶
NewKeepalive creates a new keepalive manager.
func (*Keepalive) Begin ¶
Begin marks the beginning of an in-flight request for a server. Any existing idle timer is canceled so a long-running request is never evicted.
func (*Keepalive) End ¶
End marks completion of an in-flight request for a server. The idle timer starts only after the final in-flight request completes.
func (*Keepalive) SetOnAllIdle ¶
func (k *Keepalive) SetOnAllIdle(fn func())
SetOnAllIdle configures an optional callback fired once the final idle timer expires and there are no in-flight requests remaining.