-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathworker.ts
More file actions
70 lines (59 loc) · 1.28 KB
/
worker.ts
File metadata and controls
70 lines (59 loc) · 1.28 KB
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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
export type language = "python3" | "javascript";
export type fileFormat = "py" | "js";
export type Stdout = string;
export interface CodeContext {
/**
* raw string code to be excuted
*/
code: string;
/**
* A method name in class to be executed
*/
functionName: string;
}
interface BaseError {
/**
* Indicates an error during the process of spinning up the container
*/
error: boolean;
/**
* An error message in case the job fails
*/
errorMessage?: string;
}
export interface ContainerInitialization extends BaseError {
/**
* The ID of the newly created container
*/
containerID: string;
}
export interface WriteFileStatus {
/**
* Newly created temp file that contain the context if exists
*/
filePath: string;
/**
* The file format of the created file
*/
fileFormat: string;
}
export interface JobStatus extends BaseError {
/**
* A brief message that describes that job status
*/
message: string;
/**
* indicates if the job is retryable
*/
retryable: boolean;
/**
* Newly created temp file that contain the context if exists
*/
filePath?: string;
}
export interface ExecuteContainer extends BaseError {
/**
* stdout from the container as a result of running the code
*/
codeOutput?: Stdout;
}