From 46cd171c9ff217583772ba83987608d292828f2f Mon Sep 17 00:00:00 2001 From: Timur Shemsedinov Date: Sat, 6 Feb 2021 13:52:39 +0200 Subject: [PATCH] Don't inject Channel to Server This changes Server.constructor signature from `(config, { Channel, application })` to `(config, application)` so should be published with new version of impress Refs: https://github.com/metarhia/impress/pull/1459 PR-URL: https://github.com/metarhia/metacom/pull/131 --- lib/server.js | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/lib/server.js b/lib/server.js index 5da88b7c..217c80ca 100644 --- a/lib/server.js +++ b/lib/server.js @@ -8,7 +8,7 @@ const metautil = require('metautil'); const ws = require('ws'); const { Semaphore } = require('./semaphore.js'); -const { channels } = require('./channel.js'); +const { Channel, channels } = require('./channel.js'); const SHUTDOWN_TIMEOUT = 5000; const SHORT_TIMEOUT = 500; @@ -28,10 +28,9 @@ const receiveBody = async (req) => { }; class Server { - constructor(config, { application, Channel }) { + constructor(config, application) { this.config = config; this.application = application; - this.Channel = Channel; const { host, balancer, protocol, ports, concurrency, queue } = config; this.semaphore = new Semaphore(concurrency, queue.size, queue.timeout); const { threadId } = worker; @@ -54,7 +53,6 @@ class Server { } async listener(req, res) { - const { Channel } = this; let finished = false; const { url } = req; const channel = await new Channel(req, res, null, this.application);