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