node-firebird-driver-native
Version:
Firebird Native Driver for Node.js
24 lines • 910 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.EventsImpl = void 0;
const impl_1 = require("node-firebird-driver/dist/lib/impl");
const fb = require("node-firebird-native-api");
/** Events implementation. */
class EventsImpl extends impl_1.AbstractEvents {
static async queue(attachment, names, callBack) {
const events = new EventsImpl(attachment);
const { client } = attachment;
events.eventCallback = await fb.queueEvent(client.master, attachment.attachmentHandle, names, callBack);
return events;
}
/** Disposes this events' resources. */
async internalCancel() {
if (this.eventCallback) {
const { eventCallback } = this;
this.eventCallback = undefined;
await fb.cancelEvent(eventCallback);
}
}
}
exports.EventsImpl = EventsImpl;
//# sourceMappingURL=events.js.map