Skip to content

Commit

Permalink
fix: AsyncSRT types and tests, add super() to AsyncSRT constructor (#67)
Browse files Browse the repository at this point in the history
* add event emitter to async class

* fix types for AsyncSRT class

* Should call super() on constructor as extending event emitter, fixes tests
  • Loading branch information
yaruno committed Nov 20, 2023
1 parent cf06fe6 commit f7938b4
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/async.js
Original file line number Diff line number Diff line change
Expand Up @@ -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'));
Expand Down
4 changes: 2 additions & 2 deletions types/srt-api-async.d.ts
Original file line number Diff line number Diff line change
@@ -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;

Expand Down

0 comments on commit f7938b4

Please sign in to comment.