MCPcopy Create free account
hub / github.com/HyBuildNet/quic-relay / Touch

Method Touch

internal/handler/context.go:59–61  ·  view source on GitHub ↗

Touch updates the last activity timestamp atomically. Uses coarse clock (1-second resolution) to avoid syscalls on every packet. Safe to call from multiple goroutines.

()

Source from the content-addressed store, hash-verified

57// Uses coarse clock (1-second resolution) to avoid syscalls on every packet.
58// Safe to call from multiple goroutines.
59func (s *Session) Touch() {
60 s.LastActivity.Store(coarseTime.Load())
61}
62
63// IdleDuration returns time since last activity.
64func (s *Session) IdleDuration() time.Duration {

Callers 4

TestSession_TouchFunction · 0.95
TestSession_IdleDurationFunction · 0.95
OnPacketMethod · 0.80
backendToClientMethod · 0.80

Calls

no outgoing calls

Tested by 2

TestSession_TouchFunction · 0.76
TestSession_IdleDurationFunction · 0.76