Files
fn-serverless/api/runnerpool/placer_config.go
Andrea Rosa 182db94fad Feature/acksync response writer (#1267)
This implements a "detached" mechanism to get an ack from the runner
once it actually starts to run a function. In this scenario the response
returned back is just a 202 if we placed the function in a specific
time-frame. If we hit some errors or we fail to place the fn in time we
return back different errors.
2018-11-09 10:25:43 -08:00

26 lines
727 B
Go

package runnerpool
import (
"time"
)
// Common config for placers.
type PlacerConfig struct {
// After all runners in the runner list is tried, apply a delay before retrying.
RetryAllDelay time.Duration `json:"retry_all_delay"`
// Maximum amount of time a placer can hold a request during runner attempts
PlacerTimeout time.Duration `json:"placer_timeout"`
// Maximum amount of time a placer can hold an ack sync request during runner attempts
DetachedPlacerTimeout time.Duration `json:"detached_placer_timeout"`
}
func NewPlacerConfig() PlacerConfig {
return PlacerConfig{
RetryAllDelay: 10 * time.Millisecond,
PlacerTimeout: 360 * time.Second,
DetachedPlacerTimeout: 30 * time.Second,
}
}