Skip to content

Commit

Permalink
Don't inject Channel to Server
Browse files Browse the repository at this point in the history
This changes Server.constructor signature from
`(config, { Channel, application })` to `(config, application)`
so should be published with new version of impress

Refs: metarhia/impress#1459

PR-URL: #131
  • Loading branch information
tshemsedinov committed Feb 6, 2021
1 parent ac087ec commit 46cd171
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions lib/server.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;
Expand All @@ -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);
Expand Down

0 comments on commit 46cd171

Please sign in to comment.