web-worker

DelayedJob ERROR: there is already one or more instance(s) of the program running

拜拜、爱过 提交于 2021-02-20 14:12:35
问题 Some backstory: My server ran out of disk space last night while delayed_job workers were running off jobs processing images. When I try to stop the workers, I get the response "Terminated". RAILS_ENV=production script/delayed_job stop Terminated Then I run the following to see that the workers were terminated. ps -ef | grep delayed_job servername 4474 4274 0 02:37 pts/1 00:00:00 grep --color=auto delayed_job Now I try to start up new workers. RAILS_ENV=production script/delayed_job -n2 start

DelayedJob ERROR: there is already one or more instance(s) of the program running

核能气质少年 提交于 2021-02-20 14:05:21
问题 Some backstory: My server ran out of disk space last night while delayed_job workers were running off jobs processing images. When I try to stop the workers, I get the response "Terminated". RAILS_ENV=production script/delayed_job stop Terminated Then I run the following to see that the workers were terminated. ps -ef | grep delayed_job servername 4474 4274 0 02:37 pts/1 00:00:00 grep --color=auto delayed_job Now I try to start up new workers. RAILS_ENV=production script/delayed_job -n2 start

JavaScript Web Worker - close() vs terminate()

天大地大妈咪最大 提交于 2021-02-17 21:11:46
问题 I'm not totally understanding the difference between the close() vs terminate() methods for Web Workers. I've read the descriptions here and it seems to be doing the same thing?? http://www.w3.org/TR/workers/ When would I use one over the other? 回答1: The close() method is visible inside the worker's scope. The terminate() method is a part of the worker object's interface and can be called "from the outside". If you create a worker in your main script and want to stop it from that script you

JavaScript Web Worker - close() vs terminate()

巧了我就是萌 提交于 2021-02-17 21:11:11
问题 I'm not totally understanding the difference between the close() vs terminate() methods for Web Workers. I've read the descriptions here and it seems to be doing the same thing?? http://www.w3.org/TR/workers/ When would I use one over the other? 回答1: The close() method is visible inside the worker's scope. The terminate() method is a part of the worker object's interface and can be called "from the outside". If you create a worker in your main script and want to stop it from that script you

Visual Studio Node: debug into Worker Threads (node 11)

℡╲_俬逩灬. 提交于 2021-02-16 04:33:36
问题 Can VS Code's Javascript debugger be made to debug node 11's new "Worker Threads"? Worker threads are modelled after web workers with a small number of extra capabilities on top and are available from the new worker_threads package (see https://nodejs.org/api/worker_threads.html). Other than with node's sub processes, one can share memory with worker threads in the form of SharedArrayBuffers. My VS Code launch configuration looks like that: { "type": "node", "request": "launch", "name":

Visual Studio Node: debug into Worker Threads (node 11)

眉间皱痕 提交于 2021-02-16 04:28:05
问题 Can VS Code's Javascript debugger be made to debug node 11's new "Worker Threads"? Worker threads are modelled after web workers with a small number of extra capabilities on top and are available from the new worker_threads package (see https://nodejs.org/api/worker_threads.html). Other than with node's sub processes, one can share memory with worker threads in the form of SharedArrayBuffers. My VS Code launch configuration looks like that: { "type": "node", "request": "launch", "name":

bundle web workers as integral part of npm package with single file webpack output

匆匆过客 提交于 2021-02-10 06:29:09
问题 I am writing an npm package which is a plugin for the popular library leafletjs. I am using webpack to bundle the package. I want this package to be able to spawn and destroy some web workers on command. The web worker code is part of my source files. But I want to be able to distribute my package both as an npm module, or through a cdn, meaning it must be compiled down to a singular file that can be included through an HTML header. I am using webpack to do it. So lets say I have a worker

Failed to execute 'postMessage' on 'DedicatedWorkerGlobalScope': The provided value cannot be converted to a sequence

a 夏天 提交于 2021-02-08 13:10:57
问题 I'm getting the following error Uncaught TypeError: Failed to execute 'postMessage' on 'DedicatedWorkerGlobalScope': The provided value cannot be converted to a sequence. on this line in a webworker: postMessage("hi", "http://localhost:8000"); (in fact, that is the entirety of the webworker). The base file contains: var myWorker = new Worker("test.js"); myWorker.onmessage = function (e) { console.log('Message received from worker'); }; I'm not sure which value it's complaining about and I'm

Failed to execute 'postMessage' on 'DedicatedWorkerGlobalScope': The provided value cannot be converted to a sequence

无人久伴 提交于 2021-02-08 13:04:57
问题 I'm getting the following error Uncaught TypeError: Failed to execute 'postMessage' on 'DedicatedWorkerGlobalScope': The provided value cannot be converted to a sequence. on this line in a webworker: postMessage("hi", "http://localhost:8000"); (in fact, that is the entirety of the webworker). The base file contains: var myWorker = new Worker("test.js"); myWorker.onmessage = function (e) { console.log('Message received from worker'); }; I'm not sure which value it's complaining about and I'm

404 on Karma when trying to use web worker

こ雲淡風輕ζ 提交于 2021-02-08 04:37:27
问题 I'm getting the error WARN [web-server]: 404: /app/workers/total.js when trying to run a unit test on a web worker. Karma.conf.js includes the following: ... files: [ ... 'app/workers/*.js', 'unit-tests/mocks/**/*.js', 'unit-tests/src/**/*.js' ], .... the test goes as follows: describe('totals', function () { var worker; beforeEach(function() { worker = new Worker('/app/workers/total.js'); }); it('should do something', function () { ... }); }); I have tried many urls, but none seem to work