MCPcopy Create free account
hub / github.com/modelcontextprotocol/go-sdk / endPOST

Method endPOST

mcp/streamable.go:97–114  ·  view source on GitHub ↗

endPOST signals that a request for this session is ending, starting the timeout if there are no other requests running.

()

Source from the content-addressed store, hash-verified

95// endPOST signals that a request for this session is ending, starting the
96// timeout if there are no other requests running.
97func (i *sessionInfo) endPOST() {
98 if i.timeout <= 0 {
99 return
100 }
101
102 i.timerMu.Lock()
103 defer i.timerMu.Unlock()
104
105 if i.timer == nil {
106 return // timer stopped permanently
107 }
108
109 i.refs--
110 assert(i.refs >= 0, "negative ref count")
111 if i.refs == 0 {
112 i.timer.Reset(i.timeout)
113 }
114}
115
116// stopTimer stops the inactivity timer permanently.
117func (i *sessionInfo) stopTimer() {

Callers 1

ServeHTTPMethod · 0.95

Calls 1

assertFunction · 0.85

Tested by

no test coverage detected