Comments (2)
I'm very excited about this @ayushn21! I remember feeling disappointed that I had to jump through a lot of hoops to get live reload via SSE to work sorta OK without tying up threads and making regular responses hang. With this new Rack 3 streaming approach, does that mean SSE could work on routes generally without sucking up all the Puma threads?
from bridgetown.
With this new Rack 3 streaming approach, does that mean SSE could work on routes generally without sucking up all the Puma threads?
Yes, that's the general idea. The same approach was possible with Rack 2 as well, just felt a bit hacky. Rack 3 has formally adopted the paradigm of bi-directional communication making something like this a lot easier. I really need to blog about this.
We'll still need to create a Thread
of our own to free up the Puma thread, but I've got a few prototypes working so hopefully shouldn't be a massive problem.
In terms of doing this in production, that's probably still a bad idea with Puma. Since we're creating our own thread to free up the Puma thread, we're also responsible for managing it. In dev, that's not an issue since it's just one thread for live reload. In production, where there are multiple connections, it could all get unwieldy very quickly without proper thread management which is difficult at the best of times.
This is where Falcon shines actually because it uses Fibers and is incredible at switching between them. In that case we wouldn't have to worry about creating our own thread or anything, we can just let Falcon take care of everything.
from bridgetown.
Related Issues (20)
- esbuild can't import scss files from node_modules HOT 1
- LogWriter not compatible with the Ruby 3.3 implementation of Logger HOT 1
- feat: `_html` translation key automatic safety support HOT 1
- docs: show how to read collections in SSR mode HOT 2
- NameError when using bridgetown-activerecord with Roda HOT 6
- Issue with Resource API following #778 HOT 1
- docs: use symbolic link for `bt` binstub HOT 3
- Remove hard dependency on Puma and add generic Rack compliance
- feat: make PostCSS optional…possibly off by default HOT 3
- Remove or extract `doctor` command
- Spike: find a suitable Inflector HOT 14
- Fast Refresh: asset paths (islands)
- Fast Refresh: i18n
- docs: Fast Refresh
- docs: Streamlined
- docs: /docs/content/pagination
- feature: easy adoption of Bridgetown for Obsidian vaults and similar Markdown folders HOT 1
- docs: Updated Routes syntax, other additional Roda features
- Starting the server on a fresh project with Lit fails
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from bridgetown.