Comments (4)
But, if the handler just calls another class that gets reloaded, it's ok. Example:
# in controller/my_controller.rb
module Identity
class SignupController
def signup_token
# changes here are auto-reloaded
end
end
end
So I guess that's the mounted object that gets built once and for all and is never reloaded. Which makes sense since the mount
call has no reason to be executed again. Am I getting that right? Maybe it's related to #34 ?
from rack-app.
Hi @qortex,
Can you explain a bit more about what does it mean "Now, I change the signup_token response"?
Maybe if you could provide a use-case, I would greatly appreciate it. 👍
Does that mean, there is a use-case where you dynamically rewrite your code in runtime,
or this is about local development with some form of hot reload like the rtomayko/shotgun tool?
On a high level, I rarely had use-case where the application source code is interpreted multiple times into the same process runtime, so it's uncharted waters for me. I used the tool mentioned above, shotgun, but that one always makes a new process fork and load the code in the isolated forked process during the HTTP request.
Cheers,
Adam L.
from rack-app.
I use vanilla Rack::Reloader to handle hot-reloading. I didn't dig into Shotgun but I understand it serves the same purpose (I saw comments about it not being good for multithreading though, didn't explore).
I think what happens is what I described above, but I guess it's not really worthwhile to spend time fixing it. For it to prove useful, it would mean the logic inside the request handler is complex and often changed. And that would advocate for factoring it out in a controller class -- which works well with reloading as I described above.
I'll close this issue, let me know if you think it should stay open!
from rack-app.
I think it's still wort to think about it. Maybe if I change how the application is being built, I could provide some form of option that disables the way how the route is pre-built.
Shotgun is a development tool, should not be used too much with multithreading, unless your application is written in a way that you use ruby threads to provide some form of queue -ing, but I advise against that until ruby3 + process guilds.
from rack-app.
Related Issues (20)
- unify #params method with the #payload method behaviour HOT 1
- add support for configuration passing to mounted applications HOT 6
- cli routes can show details related to the endpoints HOT 1
- EuRuKo meeting at Budapest (2017/09/29) HOT 2
- Unexpected behavior of request param parsing HOT 6
- What happened to the website? HOT 7
- Website DNS routing problem HOT 2
- remove application configuration need during runtime
- RSpec warnings HOT 4
- [Question -- feature request?] Testing a rack-app with middlewares HOT 7
- Error handler for mounted app HOT 3
- POST request without Content-Length header on WEBrick yields HTTP status code 411 HOT 4
- SPIKE: play around with Ruby 3 beta version.
- Rack::App::FileServer.serve_file gives Errno::EPERM when file served from a shared folder where multiple user keep files like the temp directory. HOT 7
- How to serve static assets with Rack::App? HOT 6
- params is empty {} when send form to post "/hello" HOT 5
- serializer block is not executed on http_status! responses HOT 2
- support json error response on validation HOT 1
- Website Squatted HOT 16
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 rack-app.