mirror of
https://github.com/fnproject/fn.git
synced 2022-10-28 21:29:17 +03:00
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.
26 lines
727 B
Go
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,
|
|
}
|
|
}
|