gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[taler-wallet-core] branch master updated: only import worker_threads wh


From: gnunet
Subject: [taler-wallet-core] branch master updated: only import worker_threads when we create a worker factory
Date: Mon, 24 Feb 2020 18:27:05 +0100

This is an automated email from the git hooks/post-receive script.

dold pushed a commit to branch master
in repository wallet-core.

The following commit(s) were added to refs/heads/master by this push:
     new 02c265f6 only import worker_threads when we create a worker factory
02c265f6 is described below

commit 02c265f68488c5f6b65a1b889d626f5c1dedb2a9
Author: Florian Dold <address@hidden>
AuthorDate: Mon Feb 24 22:56:54 2020 +0530

    only import worker_threads when we create a worker factory
---
 src/crypto/workers/nodeThreadWorker.ts | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/crypto/workers/nodeThreadWorker.ts 
b/src/crypto/workers/nodeThreadWorker.ts
index 35aa657b..e40f3c95 100644
--- a/src/crypto/workers/nodeThreadWorker.ts
+++ b/src/crypto/workers/nodeThreadWorker.ts
@@ -19,8 +19,6 @@ import { CryptoWorkerFactory } from "./cryptoApi";
 // tslint:disable:no-var-requires
 
 import { CryptoWorker } from "./cryptoWorker";
-
-import worker_threads = require("worker_threads");
 import os = require("os");
 import { CryptoImplementation } from "./cryptoImplementation";
 
@@ -84,6 +82,7 @@ export function handleWorkerMessage(msg: any) {
 
     try {
       const result = (impl as any)[operation](...args);
+      const worker_threads = require("worker_threads");
       const p = worker_threads.parentPort;
       worker_threads.parentPort?.postMessage;
       if (p) {
@@ -133,9 +132,10 @@ class NodeThreadCryptoWorker implements CryptoWorker {
    */
   onerror: undefined | ((m: any) => void);
 
-  private nodeWorker: worker_threads.Worker;
+  private nodeWorker: import("worker_threads").Worker;
 
   constructor() {
+    const worker_threads = require("worker_threads");
     this.nodeWorker = new worker_threads.Worker(workerCode, { eval: true });
     this.nodeWorker.on("error", (err: Error) => {
       console.error("error in node worker:", err);

-- 
To stop receiving notification emails like this one, please contact
address@hidden.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]