forked from grailbio/reflow
-
Notifications
You must be signed in to change notification settings - Fork 0
/
exec.go
29 lines (23 loc) · 817 Bytes
/
exec.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
// Copyright 2017 GRAIL, Inc. All rights reserved.
// Use of this source code is governed by the Apache 2.0
// license that can be found in the LICENSE file.
package local
import (
"context"
"github.com/grailbio/reflow"
)
// execState describes the current state of an exec.
type execState int
const (
execUnstarted execState = iota // the exec state machine has yet to start
execInit // the exec state machine has started
execCreated // the Docker container has been created
execRunning // the Docker container is running
execComplete // the Docker container has completed running; the results are available
)
type exec interface {
reflow.Exec
Go(context.Context)
WaitUntil(execState) error
Kill(context.Context) error
}