mirror of
https://github.com/fnproject/fn.git
synced 2022-10-28 21:29:17 +03:00
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.
This commit is contained in:
committed by
Tolga Ceylan
parent
2df6c8d349
commit
182db94fad
@@ -14,6 +14,8 @@ const (
|
||||
TypeSync = "sync"
|
||||
// TypeAsync ...
|
||||
TypeAsync = "async"
|
||||
// TypeDetached is used for calls which return an ack to the caller as soon as the call starts
|
||||
TypeDetached = "detached"
|
||||
)
|
||||
|
||||
var possibleStatuses = [...]string{"delayed", "queued", "running", "success", "error", "cancelled"}
|
||||
|
||||
@@ -156,6 +156,16 @@ var (
|
||||
error: errors.New("Async functions are not supported on this server"),
|
||||
}
|
||||
|
||||
ErrDetachUnsupported = err{
|
||||
code: http.StatusNotImplemented,
|
||||
error: errors.New("Detach call functions are not supported on this server"),
|
||||
}
|
||||
|
||||
ErrCallHandlerNotFound = err{
|
||||
code: http.StatusInternalServerError,
|
||||
error: errors.New("Unable to find the call handle"),
|
||||
}
|
||||
|
||||
// TODO consider removal. see rationale at uses, or remove if none.
|
||||
ErrContainerExitedEarly = err{
|
||||
code: http.StatusBadGateway,
|
||||
|
||||
Reference in New Issue
Block a user