mirror of
https://github.com/hzrd149/nostrudel.git
synced 2025-04-05 02:20:26 +02:00
remove old relay code
This commit is contained in:
parent
08d392acf9
commit
3a54499e3a
@ -1,53 +1,4 @@
|
||||
// import { Signal } from "../../helpers/signal";
|
||||
// import { getRelays } from "../settings";
|
||||
// import { Relay } from "./relay";
|
||||
|
||||
import relayPool, { RelayPool } from "./relay-pool";
|
||||
import { Relay } from "./relay";
|
||||
|
||||
// const connections = new Map();
|
||||
// export const onEvent = new Signal();
|
||||
|
||||
// export function getAllActive() {
|
||||
// return Array.from(connections.values()).filter((relay) => relay.connected);
|
||||
// }
|
||||
|
||||
// export async function connectToRelay(url) {
|
||||
// if (!connections.has(url)) {
|
||||
// const relay = new Relay(url);
|
||||
// connections.set(url, relay);
|
||||
|
||||
// // send all onEvent events to the main onEvent signal
|
||||
// relay.onEvent.addConnection(onEvent);
|
||||
// }
|
||||
// }
|
||||
// export async function connectToRelays() {
|
||||
// const relayUrls = await getRelays();
|
||||
|
||||
// for (const url of relayUrls) {
|
||||
// await connectToRelay(url);
|
||||
// }
|
||||
// }
|
||||
|
||||
// const messageQueue = [];
|
||||
// export async function sendNextMessage() {
|
||||
// const next = messageQueue.shift();
|
||||
// if (!next) return;
|
||||
// let sent = false;
|
||||
// for (const [url, relay] of connections) {
|
||||
// if (relay.connected) {
|
||||
// relay.send(next);
|
||||
// sent = true;
|
||||
// }
|
||||
// }
|
||||
// if (!sent) {
|
||||
// messageQueue.unshift(next);
|
||||
// }
|
||||
// }
|
||||
// setInterval(sendNextMessage, 100);
|
||||
|
||||
// export function subscribeToAuthor(pubkey) {
|
||||
// messageQueue.push(["REQ", "test", { authors: [pubkey] }]);
|
||||
// }
|
||||
|
||||
export { relayPool, Relay, RelayPool };
|
||||
|
Loading…
x
Reference in New Issue
Block a user