Sha256: dc12ba54f552241ecc51382ce29eec45ddcaa613f7510ebf858e77ec7f1de258

Contents?: true

Size: 530 Bytes

Versions: 79

Compression:

Stored size: 530 Bytes

Contents

module Zookeeper
  module Forked
    # the includer provides an 'original_pid' method, which is set
    # when the original 'owning' process creates the object. 
    #
    # @return [true] if the current PID differs from the original_pid value
    # @return [false] if the current PID matches the original_pid value
    #
    def forked?
      Process.pid != original_pid
    end

    # sets the `original_pid` to the current value
    def update_pid!
      self.original_pid = Process.pid
    end
  end # Forked
end # Zookeeper

Version data entries

79 entries across 79 versions & 2 rubygems

Version Path
zookeeper-1.2.2-java lib/zookeeper/forked.rb
zookeeper-1.2.1 lib/zookeeper/forked.rb
zookeeper-1.2.1-java lib/zookeeper/forked.rb
zookeeper-1.1.3 lib/zookeeper/forked.rb
zookeeper-1.1.3-java lib/zookeeper/forked.rb
zookeeper-1.2.0 lib/zookeeper/forked.rb
zookeeper-1.2.0-java lib/zookeeper/forked.rb
zookeeper-1.1.2 lib/zookeeper/forked.rb
zookeeper-1.1.2-java lib/zookeeper/forked.rb
zookeeper-1.1.1 lib/zookeeper/forked.rb
zookeeper-1.1.1-java lib/zookeeper/forked.rb
zookeeper-1.1.0 lib/zookeeper/forked.rb
zookeeper-1.1.0-java lib/zookeeper/forked.rb
zookeeper-1.0.6 lib/zookeeper/forked.rb
zookeeper-1.0.6-java lib/zookeeper/forked.rb
zookeeper-1.0.5 lib/zookeeper/forked.rb
zookeeper-1.0.5-java lib/zookeeper/forked.rb
zookeeper-1.0.4 lib/zookeeper/forked.rb
zookeeper-1.0.4-java lib/zookeeper/forked.rb