* Stops the service if it is not currently running. This function will kill * the server immediately. To synchronize with the active control flow, use * #stop(). * @return {!Promise} A promise that will be resolved when the server has been * stopped.
()
| 282 | * stopped. |
| 283 | */ |
| 284 | kill() { |
| 285 | if (!this.address_ || !this.command_) { |
| 286 | return Promise.resolve() // Not currently running. |
| 287 | } |
| 288 | let cmd = this.command_ |
| 289 | this.address_ = null |
| 290 | this.command_ = null |
| 291 | return cmd.then((c) => c.kill('SIGTERM')) |
| 292 | } |
| 293 | } |
| 294 | |
| 295 | /** |