AWS Api Gateway now supports websockets which allows for our serverless API to accept socket connections and push data to consumers. See https://github.com/neverendingqs/serverless-websocket-example
A partial implementation of this feature can be found in backend/src/connection.ts
Implementing this feature would require the following things to be done
On websocket connection, store socketId to playerId mapping in a fast in-memory db like Redis
When data is to be pushed to a player, lookup this Redis db and find the socketId which will be passed to the ApiGateway websocket API to push data
On the frontend side, a socket connection would have to be established and listeners setup to listen for events from the backend
AWS Api Gateway now supports websockets which allows for our serverless API to accept socket connections and push data to consumers. See https://github.com/neverendingqs/serverless-websocket-example
A partial implementation of this feature can be found in backend/src/connection.ts
Implementing this feature would require the following things to be done
On websocket connection, store socketId to playerId mapping in a fast in-memory db like Redis
When data is to be pushed to a player, lookup this Redis db and find the socketId which will be passed to the ApiGateway websocket API to push data
On the frontend side, a socket connection would have to be established and listeners setup to listen for events from the backend