| 459 | } |
| 460 | |
| 461 | subscribe(handlers) { |
| 462 | // Subscribe to call window (start/end) |
| 463 | if (handlers.start || handlers.end) { |
| 464 | this.#callWindow.subscribe({ |
| 465 | start: handlers.start, |
| 466 | end: handlers.end, |
| 467 | }); |
| 468 | } |
| 469 | |
| 470 | // Subscribe to continuation window (asyncStart/asyncEnd) |
| 471 | if (handlers.asyncStart || handlers.asyncEnd) { |
| 472 | this.#continuationWindow.subscribe({ |
| 473 | start: handlers.asyncStart, |
| 474 | end: handlers.asyncEnd, |
| 475 | }); |
| 476 | } |
| 477 | |
| 478 | // Subscribe to error channel |
| 479 | if (handlers.error) { |
| 480 | this.error.subscribe(handlers.error); |
| 481 | } |
| 482 | } |
| 483 | |
| 484 | unsubscribe(handlers) { |
| 485 | let done = true; |