felangel / web_socket_client

A simple WebSocket client for Dart which includes automatic reconnection logic.
https://pub.dev/packages/web_socket_client
MIT License
150 stars 32 forks source link

feat: add message queue to `WebSocket` class #24

Closed hamed-rezaee closed 3 months ago

hamed-rezaee commented 1 year ago

WebSocket Client - Message Queue Feature

This pull request adds a message queue feature to the WebSocket class to handle message queuing and ensure messages are sent in the correct order when the WebSocket connection is not yet established. The message queue stores messages that need to be transmitted to the server over the WebSocket connection until the connection is ready.

Changes Made

Reasoning

The addition of the message queue ensures that messages are sent in the order they were queued once the WebSocket connection is established. This improves the reliability and consistency of the WebSocket client, preventing potential issues with message order and avoiding unresponsive behavior when sending messages before the connection is ready.

Type of Change

felangel commented 3 months ago

Closing this for now since it's quite old and missing tests. I'm planning to add buffering in the near future πŸ‘