rename proxy services
This commit is contained in:
parent
4a219b8c53
commit
5eb0f69c3d
|
@ -4,13 +4,13 @@ import {
|
||||||
LimitedCacheStorage,
|
LimitedCacheStorage,
|
||||||
ProxiedWorkerLimitedCache,
|
ProxiedWorkerLimitedCache,
|
||||||
} from 'types/cache';
|
} from 'types/cache';
|
||||||
import ElectronCacheStorageProxy from './electronCacheStorage.proxy';
|
import WorkerProxyElectronCacheStorage from './workerProxyElectronCacheStorage';
|
||||||
import { wrap } from 'comlink';
|
import { wrap } from 'comlink';
|
||||||
|
|
||||||
export default class ReverseProxiedElectronCacheStorageProxy
|
export default class WorkerReverseProxyElectronCacheStorage
|
||||||
implements LimitedCacheStorage
|
implements LimitedCacheStorage
|
||||||
{
|
{
|
||||||
proxiedElectronCacheService: Comlink.Remote<ElectronCacheStorageProxy>;
|
proxiedElectronCacheService: Comlink.Remote<WorkerProxyElectronCacheStorage>;
|
||||||
ready: Promise<any>;
|
ready: Promise<any>;
|
||||||
|
|
||||||
constructor() {
|
constructor() {
|
||||||
|
@ -18,7 +18,7 @@ export default class ReverseProxiedElectronCacheStorageProxy
|
||||||
}
|
}
|
||||||
async init() {
|
async init() {
|
||||||
const electronCacheStorageProxy =
|
const electronCacheStorageProxy =
|
||||||
wrap<typeof ElectronCacheStorageProxy>(self);
|
wrap<typeof WorkerProxyElectronCacheStorage>(self);
|
||||||
|
|
||||||
this.proxiedElectronCacheService =
|
this.proxiedElectronCacheService =
|
||||||
await new electronCacheStorageProxy();
|
await new electronCacheStorageProxy();
|
|
@ -1,7 +1,7 @@
|
||||||
import { LimitedCacheStorage } from 'types/cache/index';
|
import { LimitedCacheStorage } from 'types/cache/index';
|
||||||
import ElectronCacheStorage from 'services/electron/cache';
|
import ElectronCacheStorage from 'services/electron/cache/cache';
|
||||||
import { runningInElectron, runningInWorker } from 'utils/common';
|
import { runningInElectron, runningInWorker } from 'utils/common';
|
||||||
import ReverseProxiedElectronCacheStorageProxy from 'worker/electronCacheStorageProxy.worker';
|
import ReverseProxiedElectronCacheStorageProxy from 'services/electron/cache/electronCacheStorageProxy.worker';
|
||||||
|
|
||||||
export function getCacheStorage(): LimitedCacheStorage {
|
export function getCacheStorage(): LimitedCacheStorage {
|
||||||
if (runningInElectron()) {
|
if (runningInElectron()) {
|
|
@ -1,4 +1,4 @@
|
||||||
import ElectronCacheStorage from 'services/electron/cache';
|
import ElectronCacheStorage from 'services/electron/cache/cache';
|
||||||
import * as Comlink from 'comlink';
|
import * as Comlink from 'comlink';
|
||||||
import {
|
import {
|
||||||
LimitedCache,
|
LimitedCache,
|
||||||
|
@ -6,7 +6,7 @@ import {
|
||||||
ProxiedWorkerLimitedCache,
|
ProxiedWorkerLimitedCache,
|
||||||
} from 'types/cache';
|
} from 'types/cache';
|
||||||
|
|
||||||
export default class ElectronCacheStorageProxy
|
export default class WorkerProxyElectronCacheStorage
|
||||||
implements ProxiedLimitedCacheStorage
|
implements ProxiedLimitedCacheStorage
|
||||||
{
|
{
|
||||||
async open(cacheName: string) {
|
async open(cacheName: string) {
|
|
@ -2,7 +2,7 @@ import { runningInBrowser } from 'utils/common';
|
||||||
import { Remote, wrap, expose } from 'comlink';
|
import { Remote, wrap, expose } from 'comlink';
|
||||||
import { DedicatedMLWorker } from 'worker/machineLearning.worker';
|
import { DedicatedMLWorker } from 'worker/machineLearning.worker';
|
||||||
import { MachineLearningWorker } from 'types/machineLearning';
|
import { MachineLearningWorker } from 'types/machineLearning';
|
||||||
import ElectronCacheStorageProxy from 'worker/electronCacheStorage.proxy';
|
import ElectronCacheStorageProxy from 'services/electron/electronCacheStorage.proxy';
|
||||||
|
|
||||||
export class MLWorkerWithProxy {
|
export class MLWorkerWithProxy {
|
||||||
public proxy: Promise<Remote<MachineLearningWorker>>;
|
public proxy: Promise<Remote<MachineLearningWorker>>;
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
import { getCacheStorage } from 'services/cacheStorageFactory';
|
import { getCacheStorage } from 'services/cache/cacheStorageFactory';
|
||||||
import { logError } from 'utils/sentry';
|
import { logError } from 'utils/sentry';
|
||||||
|
|
||||||
export async function cached(
|
export async function cached(
|
||||||
|
|
Loading…
Reference in a new issue