matthewrudyjacobs@gmail.com
2008-Dec-05 12:18 UTC
MemoryStore should make use of an :expires_in option?
Hi there, has anyone ever looked at making ActiveSupport::Cache::MemoryStore respect the :expires_in option? I had a go, and built a plugin to add it. ActiveSupport::Cache::ExpiringMemoryStore http://github.com/matthewrudy/expiring_memory_store It should work in the same way MemcacheStore does with :expires_in. Although it will use up more memory that the basic MemoryStore, can anyone see any other problem with it? (it''s not threadsafe, but nothing is apparently, including ''require'') It''s currently our default cache_store at work, will see how that works out in production. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group. To post to this group, send email to rubyonrails-core@googlegroups.com To unsubscribe from this group, send email to rubyonrails-core+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-core?hl=en -~----------~----~----~----~------~----~------~--~---
Mislav Marohnić
2008-Dec-05 13:11 UTC
Re: MemoryStore should make use of an :expires_in option?
On Fri, Dec 5, 2008 at 13:18, matthewrudyjacobs@gmail.com < matthewrudyjacobs@gmail.com> wrote:> > Although it will use up more memory that the basic MemoryStore, > can anyone see any other problem with it? > (it''s not threadsafe, but nothing is apparently, including ''require'')The whole Rails framework is threadsafe, so I''d think twice before stating that "nothing is". --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group. To post to this group, send email to rubyonrails-core@googlegroups.com To unsubscribe from this group, send email to rubyonrails-core+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-core?hl=en -~----------~----~----~----~------~----~------~--~---
matthewrudyjacobs@gmail.com
2008-Dec-06 13:38 UTC
Re: MemoryStore should make use of an :expires_in option?
On Dec 5, 1:11 pm, "Mislav Marohnić" <mislav.maroh...@gmail.com> wrote: threadsafe, but nothing is apparently, including ''require'')> > The whole Rails framework is threadsafe, so I''d think twice before stating > that "nothing is".you obviously missed this amusing discussion on ruby-core http://twitter.com/lifo/status/1037212939 http://is.gd/a8dn :) --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group. To post to this group, send email to rubyonrails-core@googlegroups.com To unsubscribe from this group, send email to rubyonrails-core+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-core?hl=en -~----------~----~----~----~------~----~------~--~---
matthewrudyjacobs@gmail.com
2008-Dec-06 13:40 UTC
Re: MemoryStore should make use of an :expires_in option?
On Dec 6, 1:38 pm, "matthewrudyjac...@gmail.com" <matthewrudyjac...@gmail.com> wrote:> On Dec 5, 1:11 pm, "Mislav Marohnić" <mislav.maroh...@gmail.com> > wrote: > threadsafe, but nothing is apparently, including ''require'') > > > > > The whole Rails framework is threadsafe, so I''d think twice before stating > > that "nothing is". > > you obviously missed this amusing discussion on ruby-core > > http://twitter.com/lifo/status/1037212939http://is.gd/a8dn > > :)And my point was that the default cache store (MemoryStore) is already not threadsafe. But the same :expires_in functionality can easily be applied to SynchronisedMemoryStore if needed. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group. To post to this group, send email to rubyonrails-core@googlegroups.com To unsubscribe from this group, send email to rubyonrails-core+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-core?hl=en -~----------~----~----~----~------~----~------~--~---
2008/12/6 matthewrudyjacobs@gmail.com <matthewrudyjacobs@gmail.com>:> http://twitter.com/lifo/status/1037212939And that''s why Rails preloads *everything* when you have config.threadsafe! in production.rb. Even in edge where Rails has moved to using autoload, it''s all preloaded in threadsafe mode.> http://is.gd/a8dn > > :) > > >-- Cheers! - Pratik http://m.onkey.org --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group. To post to this group, send email to rubyonrails-core@googlegroups.com To unsubscribe from this group, send email to rubyonrails-core+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-core?hl=en -~----------~----~----~----~------~----~------~--~---
matthewrudyjacobs@gmail.com
2008-Dec-07 00:52 UTC
Re: MemoryStore should make use of an :expires_in option?
On Dec 6, 9:39 pm, Pratik <pratikn...@gmail.com> wrote:> 2008/12/6 matthewrudyjac...@gmail.com <matthewrudyjac...@gmail.com>: > > >http://twitter.com/lifo/status/1037212939 > > And that''s why Rails preloads *everything* when you have > config.threadsafe! in production.rb. Even in edge where Rails has > moved to using autoload, it''s all preloaded in threadsafe mode.Indeed. I haven''t actually looked at how Merb eager-loads. Maybe it doesn''t. Ultimately I don''t run in jruby. Thread-safety is a magic buzzword I''ve never made use of. been drinking too much real ale, have a good evening. MatthewRudy --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group. To post to this group, send email to rubyonrails-core@googlegroups.com To unsubscribe from this group, send email to rubyonrails-core+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-core?hl=en -~----------~----~----~----~------~----~------~--~---