https://rails.lighthouseapp.com/projects/8994-ruby-on-rails/tickets/5038-activeresource-not-handling-updates-correctly
I just added this ticket. I'm writing a Sinatra API to be consumed by
Rails and I've run into an issue where the ActiveResource
documentation specifies that on update you should
Request (unless rails already does this...)
Currently with active_support it reloads the class chain at the
beginning of each incoming HTTP request.
Suggestion: reload the class chain only if a file in a lib path *has
changed*
Thoughts?
-r
--
You received this message because you are subscribed
I am under the impression that if config.threadsafe! was set that it
preloaded all files in the require paths, instead of using autoload.
Suggestion: use autoload when threadsafe!, but with a wrapper, like
autoload :Command,'thin/command'
becomes
autoload :Command, 'wrappers/
file_t
The only way to do this in a pure Ruby way is to poll all the files in a
thread. I'm not sure if this would be more or less performant. We tried this
in Merb and people were annoyed by the constant CPU usage (3-10%) used by
polling the entire tree. Something like watchr could make this better.
If
Unfortunately, simply requiring the files in a mutex won't work. Consider
the following simplified example:
# person.rb
class Person
sleep 10
def say_hello
puts "Hello"
end
end
# mutexed autoloads
def const_missing(klass)
@mutex.synchronize do
require autoload[klass]
end
end
#
On Sat, Jul 3, 2010 at 5:04 PM, Yehuda Katz wrote:
> The only way to do this in a pure Ruby way is to poll all the files in a
> thread. I'm not sure if this would be more or less performant. We tried this
> in Merb and people were annoyed by the constant CPU usage (3-10%) used by
> polling the ent
I'm currently working on making the reload logic pluggable.
Konstantin
On Jul 3, 2010, at 22:04 , Yehuda Katz wrote:
> The only way to do this in a pure Ruby way is to poll all the files in a
> thread. I'm not sure if this would be more or less performant. We tried this
> in Merb and people we