-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathexecutor.go
More file actions
39 lines (27 loc) · 805 Bytes
/
executor.go
File metadata and controls
39 lines (27 loc) · 805 Bytes
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
30
31
32
33
34
35
36
37
38
39
package concurrent
import (
"time"
)
var (
GlobalExecutionContext ExecutionContext
)
type Executor interface {
Execute(runnable Runnable)
}
type ExecutionContext interface {
Executor
ReportFailure(cause error)
}
type ExecutorService interface {
Executor
AwaitTermination(timeout time.Duration) (terminated bool)
InvokeAll(tasks []interface{}) (future []Future, err error)
InvokeAllDuration(tasks []interface{}, timeout time.Duration) (future []Future, err error)
InvokeAny(tasks []interface{}) (future []Future, err error)
InvokeAnyDuration(tasks []interface{}, timeout time.Duration) (future []Future, err error)
IsShutdown() bool
IsTerminated() bool
Shutdown() (err error)
ShutdownNow() (runnables []Runnable, err error)
Submit(task interface{}) (future Future, err error)
}