tubesock | Websocket interface on Rack Hijack w/ Rails support | Application Framework library
kandi X-RAY | tubesock Summary
kandi X-RAY | tubesock Summary
Tubesock lets you use websockets from rack and rails 4+ by using Rack's new hijack interface to access the underlying socket connection. In contrast to other websocket libraries, Tubesock does not use a reactor (read: no eventmachine). Instead, it leverages Rails 4's new full-stack concurrency support. Note that this means you must use a concurrent server. We recommend Puma > 2.0.0.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of tubesock
tubesock Key Features
tubesock Examples and Code Snippets
Community Discussions
Trending Discussions on tubesock
QUESTION
I use firebase realtime database to save my game data. When there is no internet and I try to send the JSON data, it gives me internal errors, frequently. It seems like it tries endlessly to send the data but I only called it once. This causes error log garbage inside the console.
...ANSWER
Answered 2018-Sep-13 at 14:48This is working as intended, although clearly not as you expected. :-)
The task only completes if:
- Either the write is committed to disk on the server.
- Or the write is rejected by the (security rules on the) server.
The Firebase SDK doesn't treat a missing connection as a fatal error. It keeps a queue of pending write operations, and retries them until they succeed/fail on the server. Only then will the task complete.
This is usually great when you have a connection that occasionally drops (i.e. on mobile while moving), since Firebase handles the intermittent connectivity loss automatically.
If you want your code to not even try to write when there's no connection, you'll want to either use the internet detection API of your platform, or listen to Firebase's .info/connected
path to ensure you are connected to the Firebase back-end before trying to write. You'd typically put the latter in a global state, that you then check before any write to the database.
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install tubesock
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page