ServeManyOptions

Structin fsthttpcompute-sdk-go v1.11.0View source
1
2
3
4
5
6
7
8
9
type ServeManyOptions struct {
NextTimeout time.Duration
MaxLifetime time.Duration
MaxRequests int
Continue func() bool
}

ServeManyOptions controls the exit conditions for ServeMany. Note that Compute might terminate the request hander earlier.

Fields

NextTimeout

time.Duration

NextTimeout is the amount of time to wait for the next request

MaxLifetime

time.Duration

MaxLifetime is the total max lifetime for an instance

MaxRequests

int

MaxRequests is the maximum number of requests to serve for a single instance

Continue

func() bool

Continue is a function that determines whether to continue serving requests after the other conditions have been checked. If Continue returns false, ServeMany will exit. If Continue is nil or returns true, ServeMany will continue.