Skip to content

Commit

Permalink
fix: add event emitter to async class (#64)
Browse files Browse the repository at this point in the history
  • Loading branch information
yaruno authored Nov 20, 2023
1 parent 04ce7d2 commit bec9609
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/async.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ const debug = require('debug')('srt-async');

const { traceCallToString, extractTransferListFromParams } = require('./async-helpers');
const { SRT } = require('../build/Release/node_srt.node');
const EventEmitter = require('events');

const DEFAULT_PROMISE_TIMEOUT_MS = 3000;

Expand All @@ -15,7 +16,7 @@ const DEBUG = false;
const WORK_ID_GEN_MOD = 0xFFF;
*/

class AsyncSRT {
class AsyncSRT extends EventEmitter {

/**
* @static
Expand Down Expand Up @@ -67,6 +68,7 @@ class AsyncSRT {
'\n Binding call:', traceCallToString(data.call.method, data.call.args),
//'\n Stacktrace:', data.err.stack
);
this.emit('error', data.err.message)
return;
}

Expand Down

0 comments on commit bec9609

Please sign in to comment.