Debian Codegraph @

pkg/types/service_timeout.go

raw
1 package types
2
3 import "time"
4
5 // ServiceTimeout is implemented by a service that declares its own send budget.
6 //
7 // Embedding standard.Standard reports [DefaultSendTimeout]. A longer result extends
8 // the router wait when [SenderOptions.Timeout] is unset. A non-positive result does not.
9 type ServiceTimeout interface {
10 // ServiceTimeout returns the budget for one send.
11 //
12 // Parameters:
13 // - params: Optional send-time overrides, applied the same way as Send.
14 //
15 // Returns:
16 // - The budget. Non-positive does not extend the router wait.
17 ServiceTimeout(params *Params) time.Duration
18 }
19
20 // DefaultSendTimeout is the send budget used when a service does not report a longer one.
21 const DefaultSendTimeout = 10 * time.Second