Skip to content

Commit

Permalink
Fixed testing
Browse files Browse the repository at this point in the history
  • Loading branch information
alexatnewton committed May 11, 2022
1 parent 2458ca1 commit 54cd6a6
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
6 changes: 6 additions & 0 deletions new-connection.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/bin/bash

websocat -t - autoreconnect:ws://127.0.0.1:$1/app/app-key -v --ping-interval=15

# Send this event for testing:
# {"event": "pusher:subscribe", "data": { "channel": "public" } }
2 changes: 1 addition & 1 deletion src/adapters/horizontal-adapter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ export abstract class HorizontalAdapter extends LocalAdapter {
}
},
resolveValue: (request: Request, response: Response) => {
return request.channels;
return request.channelsWithSocketsCount;
},
},
[RequestType.CHANNEL_MEMBERS]: {
Expand Down
1 change: 0 additions & 1 deletion src/adapters/local-adapter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import { WebSocket } from 'uWebSockets.js';
export class LocalAdapter implements AdapterInterface {
// TODO: Force disconnect a specific socket
// TODO: Force disconnect all sockets from an app.
// TODO: Add a getChannelsWithSocketsCount to fetch fewer data from other nodes

/**
* The app connections storage class to manage connections.
Expand Down

0 comments on commit 54cd6a6

Please sign in to comment.