Giter VIP home page Giter VIP logo

Comments (5)

pokonski avatar pokonski commented on September 13, 2024

Thanks for reporting! Wasn't aware of such issue.

This gem needs a major overhaul with some new ideas I've came up ever since releasing it and will fix it then.

from public_activity.

bjensen avatar bjensen commented on September 13, 2024

@pokonski what is the progress on the overhaul? :-)

from public_activity.

pokonski avatar pokonski commented on September 13, 2024

@bjensen good question. I'm open for suggestions! The best idea I had so far is solving this by allowing people to supply lambdas/Procs in the defaults hash. So this would be possible:

class Article < ActiveRecord::Base
  tracked :params => {current_user: Proc.new{|controller| controller.current_user} }
end

Currently slowly working on 0.4.0 version which is going to be a major rewrite, but that will take some time.

from public_activity.

farnoy avatar farnoy commented on September 13, 2024

Currently, we store the controller in Thread.current, but I could use the technique from that blog post:

class BetterThreadedLibrary
  @@some_setting = Hash.new {|h,k| h[k] = :default }
  def self.some_setting=(val)
    @@some_setting[Thread.current.object_id] = val
  end
  def self.some_setting
    @@some_setting[Thread.current.object_id]
  end
end

however, I have to come up with a solution that works on 1.8.7 aswell and instruct garbage collector to clean up when the thread dies

from public_activity.

januszm avatar januszm commented on September 13, 2024

So is the gem in the current state (master branch) thread safe?

from public_activity.

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.