Commit 0bf24f43 authored by Linshizhi's avatar Linshizhi

Use classic Web worker.

parent 58e2992e
...@@ -18,8 +18,7 @@ export class WW extends Observable { ...@@ -18,8 +18,7 @@ export class WW extends Observable {
this.#ident = name; this.#ident = name;
this.#ww = new Worker( this.#ww = new Worker(
new URL(path, import.meta.url), new URL(path, import.meta.url)
{ type: 'module' }
); );
} }
......
import { assert } from './utils.js'; import { assert, sleep } from './utils.js';
import { WWGroup } from './WWGroup.js'; import { WWGroup } from './WWGroup.js';
import { WW } from './WW.js'; import { WW } from './WW.js';
import { Channel } from './channel.js'; import { Channel } from './channel.js';
......
This diff is collapsed.
import { sleep } from '../src/utils.js'; import { sleep } from '../src/utils.js';
import { H264EncWWGroup } from '../src/encGroup.js'; import { H264EncWWGroup } from '../src/encGroup.js';
import { Obervable, Observable } from 'rxjs'; import { Obervable, Observable } from 'rxjs';
...@@ -189,12 +188,12 @@ describe("Channel Spec", () => { ...@@ -189,12 +188,12 @@ describe("Channel Spec", () => {
describe("H264EncWWGroup Spec", () => { describe("H264EncWWGroup Spec", () => {
it("Instantiation", async () => { it("Instantiation", async () => {
let wg = new H264EncWWGroup("h264enc", { numOfWW: 3 }); let wg = new H264EncWWGroup("h264enc", { numOfWW: 2 });
await wg.start(); await wg.start();
await sleep(1000); await sleep(1000);
expect(wg.numOfWorker()).toBe(3); expect(wg.numOfWorker()).toBe(2);
}); });
......
...@@ -2,7 +2,7 @@ const path = require('path'); ...@@ -2,7 +2,7 @@ const path = require('path');
const webpack = require("webpack"); const webpack = require("webpack");
module.exports = { module.exports = {
entry: './tests/specs.js', entry: './specs.js',
mode: 'development', mode: 'development',
output: { output: {
filename: 'spec_bundle.js', filename: 'spec_bundle.js',
...@@ -16,9 +16,6 @@ module.exports = { ...@@ -16,9 +16,6 @@ module.exports = {
exclude: /node_modules/, exclude: /node_modules/,
use: ['babel-loader'] use: ['babel-loader']
}, },
{
}
] ]
}, },
plugins: [ plugins: [
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment