()
| 186 | } |
| 187 | |
| 188 | async ready(): Promise<void> { |
| 189 | if (this.pendingBackendInit != null) { |
| 190 | return this.pendingBackendInit.then(() => {}); |
| 191 | } |
| 192 | if (this.backendInstance != null) { |
| 193 | return; |
| 194 | } |
| 195 | const sortedBackends = this.getSortedBackends(); |
| 196 | |
| 197 | for (let i = 0; i < sortedBackends.length; i++) { |
| 198 | const backendName = sortedBackends[i]; |
| 199 | const success = await this.initializeBackend(backendName).success; |
| 200 | if (success) { |
| 201 | await this.setBackend(backendName); |
| 202 | return; |
| 203 | } |
| 204 | } |
| 205 | |
| 206 | throw new Error( |
| 207 | `Could not initialize any backends, all backend initializations ` + |
| 208 | `failed.`); |
| 209 | } |
| 210 | |
| 211 | get backend(): KernelBackend { |
| 212 | if (this.pendingBackendInit != null) { |
no test coverage detected