Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add core model for Websocket Connections #342

Open
wants to merge 1 commit into
base: remove-package-lock-for-now
Choose a base branch
from

Conversation

seanspeaks
Copy link
Contributor

@seanspeaks seanspeaks commented Oct 17, 2024

WebSocket Connection Management

This PR introduces a new WebsocketConnection model to manage WebSocket connections in the database. It includes functionality to store, retrieve, and send messages to active connections.

TODO:

  • Decouple from/abstract the AWS implementation, implement a Core Extension for AWS
  • Add more helper functions (e.g., for connection cleanup, batch operations)
  • Pair with a cleanup function to purge the DB of short-lived connections

The changes include:

  • New WebsocketConnection model with a schema for storing connection IDs
  • Static method getActiveConnections to retrieve and interact with active connections
  • Integration with AWS API Gateway Management API for sending messages
  • Automatic removal of stale connections
  • Export of the new model in the database index file

These additions lay the groundwork for real-time communication features in the application.

TODO
[] Decouple from/abstract the AWS implementation, implement a Core Extension for AWS
[] Add more helper functions
[] Pair with a cleanup function to purge the DB of short lived connection
Copy link

sonarcloud bot commented Oct 17, 2024

@seanspeaks seanspeaks marked this pull request as ready for review October 17, 2024 03:36
@seanspeaks seanspeaks changed the title Add core model for Websocket Connections TODO [] Decouple from/abstract the AWS implementation, implement a Core Extension for AWS [] Add more helper functions [] Pair with a cleanup function to purge the DB of short lived connection Add core model for Websocket Connections Oct 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant