summaryrefslogtreecommitdiff
path: root/packages/taler-wallet-core/src/crypto/workers
diff options
context:
space:
mode:
authorFlorian Dold <florian@dold.me>2022-11-10 13:54:39 +0100
committerFlorian Dold <florian@dold.me>2022-11-10 13:54:39 +0100
commit344b4f62a22fb8afe910f809b04485b10b51a79b (patch)
treecfa9b5cadb5a2d81be8c6d16449446646ec688d3 /packages/taler-wallet-core/src/crypto/workers
parentb65bb1af356e353051aa376ccb751476e7aa6e01 (diff)
downloadwallet-core-344b4f62a22fb8afe910f809b04485b10b51a79b.tar.gz
wallet-core-344b4f62a22fb8afe910f809b04485b10b51a79b.tar.bz2
wallet-core-344b4f62a22fb8afe910f809b04485b10b51a79b.zip
quickjs preparations, clearer worker(-factory) names
Diffstat (limited to 'packages/taler-wallet-core/src/crypto/workers')
-rw-r--r--packages/taler-wallet-core/src/crypto/workers/synchronousWorkerFactoryNode.ts (renamed from packages/taler-wallet-core/src/crypto/workers/synchronousWorkerFactory.ts)6
-rw-r--r--packages/taler-wallet-core/src/crypto/workers/synchronousWorkerFactoryPlain.ts36
-rw-r--r--packages/taler-wallet-core/src/crypto/workers/synchronousWorkerNode.ts2
-rw-r--r--packages/taler-wallet-core/src/crypto/workers/synchronousWorkerPlain.ts (renamed from packages/taler-wallet-core/src/crypto/workers/synchronousWorkerWeb.ts)2
4 files changed, 41 insertions, 5 deletions
diff --git a/packages/taler-wallet-core/src/crypto/workers/synchronousWorkerFactory.ts b/packages/taler-wallet-core/src/crypto/workers/synchronousWorkerFactoryNode.ts
index e9d67eec6..46cf12915 100644
--- a/packages/taler-wallet-core/src/crypto/workers/synchronousWorkerFactory.ts
+++ b/packages/taler-wallet-core/src/crypto/workers/synchronousWorkerFactoryNode.ts
@@ -19,15 +19,15 @@
*/
import { CryptoWorkerFactory } from "./cryptoDispatcher.js";
import { CryptoWorker } from "./cryptoWorkerInterface.js";
-import { SynchronousCryptoWorker } from "./synchronousWorkerNode.js";
+import { SynchronousCryptoWorkerNode } from "./synchronousWorkerNode.js";
/**
* The synchronous crypto worker produced by this factory doesn't run in the
* background, but actually blocks the caller until the operation is done.
*/
-export class SynchronousCryptoWorkerFactory implements CryptoWorkerFactory {
+export class SynchronousCryptoWorkerFactoryNode implements CryptoWorkerFactory {
startWorker(): CryptoWorker {
- return new SynchronousCryptoWorker();
+ return new SynchronousCryptoWorkerNode();
}
getConcurrency(): number {
diff --git a/packages/taler-wallet-core/src/crypto/workers/synchronousWorkerFactoryPlain.ts b/packages/taler-wallet-core/src/crypto/workers/synchronousWorkerFactoryPlain.ts
new file mode 100644
index 000000000..7662b41f5
--- /dev/null
+++ b/packages/taler-wallet-core/src/crypto/workers/synchronousWorkerFactoryPlain.ts
@@ -0,0 +1,36 @@
+/*
+ This file is part of GNU Taler
+ (C) 2019 GNUnet e.V.
+
+ GNU Taler is free software; you can redistribute it and/or modify it under the
+ terms of the GNU General Public License as published by the Free Software
+ Foundation; either version 3, or (at your option) any later version.
+
+ GNU Taler is distributed in the hope that it will be useful, but WITHOUT ANY
+ WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
+ A PARTICULAR PURPOSE. See the GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License along with
+ GNU Taler; see the file COPYING. If not, see <http://www.gnu.org/licenses/>
+ */
+
+/**
+ * Imports.
+ */
+import { CryptoWorkerFactory } from "./cryptoDispatcher.js";
+import { CryptoWorker } from "./cryptoWorkerInterface.js";
+import { SynchronousCryptoWorkerPlain } from "./synchronousWorkerPlain.js";
+
+/**
+ * The synchronous crypto worker produced by this factory doesn't run in the
+ * background, but actually blocks the caller until the operation is done.
+ */
+export class SynchronousCryptoWorkerFactoryPlain implements CryptoWorkerFactory {
+ startWorker(): CryptoWorker {
+ return new SynchronousCryptoWorkerPlain();
+ }
+
+ getConcurrency(): number {
+ return 1;
+ }
+}
diff --git a/packages/taler-wallet-core/src/crypto/workers/synchronousWorkerNode.ts b/packages/taler-wallet-core/src/crypto/workers/synchronousWorkerNode.ts
index 1f83dc519..b2653158c 100644
--- a/packages/taler-wallet-core/src/crypto/workers/synchronousWorkerNode.ts
+++ b/packages/taler-wallet-core/src/crypto/workers/synchronousWorkerNode.ts
@@ -31,7 +31,7 @@ const logger = new Logger("synchronousWorker.ts");
* The node crypto worker can also use IPC to offload cryptographic
* operations to a helper process (usually written in C / part of taler-exchange).
*/
-export class SynchronousCryptoWorker implements CryptoWorker {
+export class SynchronousCryptoWorkerNode implements CryptoWorker {
/**
* Function to be called when we receive a message from the worker thread.
*/
diff --git a/packages/taler-wallet-core/src/crypto/workers/synchronousWorkerWeb.ts b/packages/taler-wallet-core/src/crypto/workers/synchronousWorkerPlain.ts
index 0ba365fa1..058896828 100644
--- a/packages/taler-wallet-core/src/crypto/workers/synchronousWorkerWeb.ts
+++ b/packages/taler-wallet-core/src/crypto/workers/synchronousWorkerPlain.ts
@@ -31,7 +31,7 @@ const logger = new Logger("synchronousWorker.ts");
* Worker implementation that synchronously executes cryptographic
* operations.
*/
-export class SynchronousCryptoWorker implements CryptoWorker {
+export class SynchronousCryptoWorkerPlain implements CryptoWorker {
/**
* Function to be called when we receive a message from the worker thread.
*/