* Start the deepnote-toolkit server and connect to the kernel.
()
| 113 | * Start the deepnote-toolkit server and connect to the kernel. |
| 114 | */ |
| 115 | async start(): Promise<void> { |
| 116 | this.server = await startServer({ |
| 117 | pythonEnv: this.config.pythonEnv, |
| 118 | workingDirectory: this.config.workingDirectory, |
| 119 | port: this.config.serverPort, |
| 120 | env: this.config.env, |
| 121 | }) |
| 122 | |
| 123 | try { |
| 124 | this.kernel = new KernelClient() |
| 125 | await this.kernel.connect(this.server.url) |
| 126 | } catch (error) { |
| 127 | await this.stop() |
| 128 | throw error |
| 129 | } |
| 130 | } |
| 131 | |
| 132 | /** |
| 133 | * Stop the server and disconnect from the kernel. |
no test coverage detected