(
backendName: string,
factory: () => KernelBackend | Promise<KernelBackend>,
priority = 1)
| 258 | } |
| 259 | |
| 260 | registerBackend( |
| 261 | backendName: string, |
| 262 | factory: () => KernelBackend | Promise<KernelBackend>, |
| 263 | priority = 1): boolean { |
| 264 | if (backendName in this.registryFactory) { |
| 265 | log.warn( |
| 266 | `${backendName} backend was already registered. ` + |
| 267 | `Reusing existing backend factory.`); |
| 268 | return false; |
| 269 | } |
| 270 | this.registryFactory[backendName] = {factory, priority}; |
| 271 | return true; |
| 272 | } |
| 273 | |
| 274 | async setBackend(backendName: string): Promise<boolean> { |
| 275 | if (this.registryFactory[backendName] == null) { |
no outgoing calls
no test coverage detected