UNPKG

lisk-framework

Version:

Lisk blockchain application platform

35 lines 1.06 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.IPCServer = void 0; const zeromq_1 = require("zeromq"); const ipc_socket_1 = require("./ipc_socket"); class IPCServer extends ipc_socket_1.IPCSocket { constructor(options) { super(options); this.socketPaths = { pub: this._eventPubSocketPath, sub: this._eventSubSocketPath, rpcServer: this._rpcSeverSocketPath, }; } async start() { await super.start(); this.pubSocket = new zeromq_1.Publisher(); this.subSocket = new zeromq_1.Subscriber(); try { await this.pubSocket.bind(this._eventPubSocketPath); await this.subSocket.bind(this._eventSubSocketPath); this.subSocket.subscribe(); } catch (error) { this.pubSocket.close(); this.subSocket.close(); throw error; } } stop() { super.stop(); } } exports.IPCServer = IPCServer; //# sourceMappingURL=ipc_server.js.map