fix: AsyncSRT types and tests, add super() to AsyncSRT constructor (#67)
* add event emitter to async class * fix types for AsyncSRT class * Should call super() on constructor as extending event emitter, fixes tests
This commit is contained in:
parent
cf06fe6ed1
commit
f7938b4567
2 changed files with 3 additions and 3 deletions
|
|
@ -25,7 +25,7 @@ class AsyncSRT extends EventEmitter {
|
|||
static TimeoutMs = DEFAULT_PROMISE_TIMEOUT_MS;
|
||||
|
||||
constructor() {
|
||||
|
||||
super()
|
||||
DEBUG && debug('Creating task-runner worker instance');
|
||||
|
||||
this._worker = new Worker(path.resolve(__dirname, './async-worker.js'));
|
||||
|
|
|
|||
4
types/srt-api-async.d.ts
vendored
4
types/srt-api-async.d.ts
vendored
|
|
@ -1,11 +1,11 @@
|
|||
|
||||
import { EventEmitter } from "events";
|
||||
import { SRTLoggingLevel, SRTResult, SRTSockOpt, SRTSockStatus } from "../src/srt-api-enums";
|
||||
|
||||
import { SRTReadReturn, SRTFileDescriptor, SRTEpollEvent, SRTSockOptValue, SRTStats } from "./srt-api"
|
||||
|
||||
export type AsyncSRTCallback<T> = (result: T) => void;
|
||||
|
||||
export class AsyncSRT {
|
||||
export class AsyncSRT extends EventEmitter {
|
||||
|
||||
static TimeoutMs: number;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue