Giter Club home page Giter Club logo

Comments (4)

qortex avatar qortex commented on May 20, 2024

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.

adamluzsi avatar adamluzsi commented on May 20, 2024

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.

qortex avatar qortex commented on May 20, 2024

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.

adamluzsi avatar adamluzsi commented on May 20, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.