MCPcopy Index your code
hub / github.com/aws/aws-lambda-go / WithEnableSIGTERM

Function WithEnableSIGTERM

lambda/handler.go:87–92  ·  view source on GitHub ↗

WithEnableSIGTERM enables SIGTERM behavior within the Lambda platform on container spindown. SIGKILL will occur ~500ms after SIGTERM. Optionally, an array of callback functions to run on SIGTERM may be provided.

(callbacks ...func())

Source from the content-addressed store, hash-verified

85// SIGKILL will occur ~500ms after SIGTERM.
86// Optionally, an array of callback functions to run on SIGTERM may be provided.
87func WithEnableSIGTERM(callbacks ...func()) Option {
88 return Option(func(h *handlerOptions) {
89 h.sigtermCallbacks = append(h.sigtermCallbacks, callbacks...)
90 h.enableSIGTERM = true
91 })
92}
93
94// handlerTakesContext returns whether the handler takes a context.Context as its first argument.
95func handlerTakesContext(handler reflect.Type) (bool, error) {

Callers 2

ExampleWithEnableSIGTERMFunction · 0.92
mainFunction · 0.92

Calls 1

OptionFuncType · 0.85

Tested by 1

ExampleWithEnableSIGTERMFunction · 0.74

Used in the wild real call sites across dependent graphs

searching dependent graphs…