Return an observable that can be used to subscribe to internal events happening in the thread. Useful for debugging.
(thread: ThreadT)
| 16 | }, |
| 17 | /** Return an observable that can be used to subscribe to internal events happening in the thread. Useful for debugging. */ |
| 18 | events<ThreadT extends ThreadType>(thread: ThreadT): Observable<WorkerEvent> { |
| 19 | return thread[$events] || fail("Events observable not found. Make sure to pass a thread instance as returned by the spawn() promise.") |
| 20 | }, |
| 21 | /** Terminate a thread. Remember to terminate every thread when you are done using it. */ |
| 22 | terminate<ThreadT extends ThreadType>(thread: ThreadT) { |
| 23 | return thread[$terminate]() |