Skip to content

Commit f7938b4

Browse files
authored
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
1 parent cf06fe6 commit f7938b4

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

src/async.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ class AsyncSRT extends EventEmitter {
2525
static TimeoutMs = DEFAULT_PROMISE_TIMEOUT_MS;
2626

2727
constructor() {
28-
28+
super()
2929
DEBUG && debug('Creating task-runner worker instance');
3030

3131
this._worker = new Worker(path.resolve(__dirname, './async-worker.js'));

types/srt-api-async.d.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
1+
import { EventEmitter } from "events";
22
import { SRTLoggingLevel, SRTResult, SRTSockOpt, SRTSockStatus } from "../src/srt-api-enums";
33

44
import { SRTReadReturn, SRTFileDescriptor, SRTEpollEvent, SRTSockOptValue, SRTStats } from "./srt-api"
55

66
export type AsyncSRTCallback<T> = (result: T) => void;
77

8-
export class AsyncSRT {
8+
export class AsyncSRT extends EventEmitter {
99

1010
static TimeoutMs: number;
1111

0 commit comments

Comments
 (0)