(message: Message)
| 402 | } |
| 403 | |
| 404 | private receive(message: Message): void { |
| 405 | if (message._tag === "Ready") return this.onReady() |
| 406 | const command = this.commands.get(message.id) |
| 407 | if (command === undefined) return |
| 408 | switch (message._tag) { |
| 409 | case "Spawned": |
| 410 | this.stopTimer(message.id) |
| 411 | return command.onSpawned(message.pid) |
| 412 | case "Exit": |
| 413 | return command.onExit(message.code, message.signal) |
| 414 | case "Error": |
| 415 | this.stopTimer(message.id) |
| 416 | return command.onError(deserializeError(message.error)) |
| 417 | } |
| 418 | } |
| 419 | |
| 420 | private onReady(): void { |
| 421 | if (this.ready || this.exited) return |
no test coverage detected