Skip to content

Commit

Permalink
deprecated worker code
Browse files Browse the repository at this point in the history
  • Loading branch information
gsovereignty committed Apr 18, 2024
1 parent e056008 commit 89ac799
Show file tree
Hide file tree
Showing 10 changed files with 11 additions and 12 deletions.
5 changes: 2 additions & 3 deletions src/lib/snort_workers/live_subs.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
import { seedRelays } from '@/workers/seed_relays';
import type { Command } from './types';
import { NostrSystem, RequestBuilder } from '@snort/system';
import type { NostrEvent } from 'nostr-tools';
import { getNostrEvent } from './utils';
import { writable } from 'svelte/store';
import type { Command } from './types';
import { seedRelays } from '@/workers_snort/seed_relays';

let events = new Map<string, NostrEvent>();
let eventStore = writable(events);
Expand Down
3 changes: 2 additions & 1 deletion src/lib/snort_workers/master_worker.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
import { seedRelays } from '@/workers/seed_relays';

import { NostrSystem, RequestBuilder } from '@snort/system';
import { derived, writable } from 'svelte/store';
import { Command, FrontendData, WorkerData } from './types';
import { followsFromKind3, getNostrEvent, tagSplits } from './utils';
import type { NostrEvent } from '@nostr-dev-kit/ndk';
import WorkerVite from "./live_subs?worker"
import { seedRelays } from '@/workers_snort/seed_relays';

let workerData = new WorkerData();
let workerDataStore = writable(workerData);
Expand Down
2 changes: 1 addition & 1 deletion src/lib/snort_workers/types.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { Event, NostrEvent } from 'nostr-tools';
import type { NostrEvent } from 'nostr-tools';

export class Command {
command: 'start' | 'sub_to_pubkeys';
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
9 changes: 4 additions & 5 deletions src/lib/workers_snort/firehose.ts
Original file line number Diff line number Diff line change
@@ -1,17 +1,16 @@
import { NDKEvent, type NDKFilter, type NostrEvent } from '@nostr-dev-kit/ndk';
import NDKSvelte, { type ExtendedBaseType, type NDKEventStore } from '@nostr-dev-kit/ndk-svelte';
import { NDKEvent, type NDKFilter } from '@nostr-dev-kit/ndk';
import NDKSvelte from '@nostr-dev-kit/ndk-svelte';
import { derived, get, writable, type Writable } from 'svelte/store';

import NDKCacheAdapterDexie from '@nostr-dev-kit/ndk-cache-dexie';
import {
Command,
EventTreeItem,
FrontendData,
WorkerData,
type RecursiveEventMap
} from './firehose.types';
import { reducedRelays, seedRelays } from './seed_relays';
import { tagSplits } from './firehose.utils';
import { seedRelays } from './seed_relays';


let workerData: WorkerData | undefined; // = new ResponseData();
Expand Down Expand Up @@ -180,7 +179,7 @@ let subscribe = (pubkey?: string, pubkeys?: string[]) => {
}
if (!subbed && pubkey) {
subbed = true


sub = ndk.storeSubscribe(
{ kinds: [3], authors: [pubkey] },
Expand Down
4 changes: 2 additions & 2 deletions src/lib/workers_snort/firehose_master.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { get, writable, type Writable } from 'svelte/store';
import { Command, FrontendData, WorkerData } from './firehose.types';
import { currentPubkey } from '@/stores/user';
import { get, writable, type Writable } from 'svelte/store';
import { Command, FrontendData } from './firehose.types';


export let responseFromWorker: Writable<FrontendData> = writable(new FrontendData());
Expand Down

0 comments on commit 89ac799

Please sign in to comment.