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())
| 85 | // SIGKILL will occur ~500ms after SIGTERM. |
| 86 | // Optionally, an array of callback functions to run on SIGTERM may be provided. |
| 87 | func 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. |
| 95 | func handlerTakesContext(handler reflect.Type) (bool, error) { |
searching dependent graphs…