-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathmod.ts
More file actions
34 lines (27 loc) · 820 Bytes
/
mod.ts
File metadata and controls
34 lines (27 loc) · 820 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
import { PythonRuntimeAgent } from "./src/python-runtime-agent.ts";
import { logger } from "@runtimed/agent-core";
export { PythonRuntimeAgent };
if (import.meta.main) {
const name = "PyRunt";
const agent = new PythonRuntimeAgent();
logger.info("Starting Agent");
try {
await agent.start();
logger.info(`${name} started`, {
runtimeId: agent.config.runtimeId,
runtimeType: agent.config.runtimeType,
notebookId: agent.config.notebookId,
sessionId: agent.config.sessionId,
syncUrl: agent.config.syncUrl,
});
await agent.keepAlive();
} catch (error) {
logger.error(`${name} failed to start`, error);
Deno.exit(1);
}
agent.shutdown().catch((error) => {
logger.error(`${name} failed to shutdown`, error);
Deno.exit(1);
});
Deno.exit(0);
}