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:
yaruno 2023-11-20 12:54:11 +01:00 committed by GitHub
parent cf06fe6ed1
commit f7938b4567
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 3 deletions

View file

@ -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'));

View file

@ -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;