mirror of
https://github.com/fnproject/fn.git
synced 2022-10-28 21:29:17 +03:00
functions: hot containers (#332)
* functions: modify datastore to accomodate hot containers support * functions: protocol between functions and hot containers * functions: add hot containers clockwork * fn: add hot containers support
This commit is contained in:
40
api/runner/task/task.go
Normal file
40
api/runner/task/task.go
Normal file
@@ -0,0 +1,40 @@
|
||||
package task
|
||||
|
||||
import (
|
||||
"context"
|
||||
"io"
|
||||
"time"
|
||||
|
||||
"github.com/iron-io/runner/drivers"
|
||||
)
|
||||
|
||||
type Config struct {
|
||||
ID string
|
||||
Path string
|
||||
Image string
|
||||
Timeout time.Duration
|
||||
AppName string
|
||||
Memory uint64
|
||||
Env map[string]string
|
||||
Format string
|
||||
MaxConcurrency int
|
||||
|
||||
Stdin io.Reader
|
||||
Stdout io.Writer
|
||||
Stderr io.Writer
|
||||
}
|
||||
|
||||
// Request stores the task to be executed by the common concurrency stream,
|
||||
// whatever type the ask actually is, either sync or async. It holds in itself
|
||||
// the channel to return its response to its caller.
|
||||
type Request struct {
|
||||
Ctx context.Context
|
||||
Config *Config
|
||||
Response chan Response
|
||||
}
|
||||
|
||||
// Response holds the response metainformation of a Request
|
||||
type Response struct {
|
||||
Result drivers.RunResult
|
||||
Err error
|
||||
}
|
||||
Reference in New Issue
Block a user