mirror of
https://github.com/aljazceru/ditto.git
synced 2025-12-20 15:04:20 +01:00
relay: improve variable names in handleReq
This commit is contained in:
@@ -54,16 +54,16 @@ function connectStream(socket: WebSocket) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/** Handle REQ. Start a subscription. */
|
/** Handle REQ. Start a subscription. */
|
||||||
async function handleReq([_, subId, ...filters]: ClientREQ): Promise<void> {
|
async function handleReq([_, subId, ...rest]: ClientREQ): Promise<void> {
|
||||||
const prepared = prepareFilters(filters);
|
const filters = prepareFilters(rest);
|
||||||
|
|
||||||
for (const event of await eventsDB.getFilters(prepared)) {
|
for (const event of await eventsDB.getFilters(filters)) {
|
||||||
send(['EVENT', subId, event]);
|
send(['EVENT', subId, event]);
|
||||||
}
|
}
|
||||||
|
|
||||||
send(['EOSE', subId]);
|
send(['EOSE', subId]);
|
||||||
|
|
||||||
for await (const event of Sub.sub(socket, subId, prepared)) {
|
for await (const event of Sub.sub(socket, subId, filters)) {
|
||||||
send(['EVENT', subId, event]);
|
send(['EVENT', subId, event]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user