-
Notifications
You must be signed in to change notification settings - Fork 373
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update cached strategy to prioritize websocket
Usually, we immediately retry cached transport, which works well in most cases. However, if a client ends up with fallback transports due to a temporary connection problem, they remain with fallback for the rest of their session. This change updates the Cached Strategy to prioritize the WebSocket transport. Initially, we always try WebSocket first, even if the cached transport is, for example, long-polling. Each time we override the cached transport and connect to WebSocket, we increment the attempts value. After a few attempts, we stop prioritizing WebSocket and switch to the cached transport immediately. This change allows clients to have more chances of using WebSocket. But if we determine that fallback transports perform better in their environment, we will continue reconnecting them as quickly as possible to the cached transport.
- Loading branch information
Showing
5 changed files
with
88 additions
and
37 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters