mirror of
https://github.com/aljazceru/ditto.git
synced 2025-12-28 10:44:27 +01:00
Rework client as EventStore
This commit is contained in:
12
src/pool.ts
12
src/pool.ts
@@ -1,7 +1,5 @@
|
||||
import { getActiveRelays } from '@/db/relays.ts';
|
||||
import { Debug, type Event, RelayPoolWorker } from '@/deps.ts';
|
||||
|
||||
const debug = Debug('ditto:pool');
|
||||
import { RelayPoolWorker } from '@/deps.ts';
|
||||
|
||||
const activeRelays = await getActiveRelays();
|
||||
|
||||
@@ -17,10 +15,4 @@ const pool = new RelayPoolWorker(worker, activeRelays, {
|
||||
logErrorsAndNotices: false,
|
||||
});
|
||||
|
||||
/** Publish an event to the given relays, or the entire pool. */
|
||||
function publish(event: Event, relays: string[] = activeRelays) {
|
||||
debug('publish', event);
|
||||
return pool.publish(event, relays);
|
||||
}
|
||||
|
||||
export { activeRelays, pool, publish };
|
||||
export { activeRelays, pool };
|
||||
|
||||
Reference in New Issue
Block a user