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.5.5 lib/zookeeper/forked.rb
zookeeper-1.5.5-java lib/zookeeper/forked.rb
zookeeper-1.5.4 lib/zookeeper/forked.rb
zookeeper-1.5.4-java lib/zookeeper/forked.rb
zookeeper-1.5.3 lib/zookeeper/forked.rb
zookeeper-1.5.3-java lib/zookeeper/forked.rb
zookeeper-ng-1.5.2.1 lib/zookeeper/forked.rb
zookeeper-ng-1.5.2.1-java lib/zookeeper/forked.rb
zookeeper-1.5.1-java lib/zookeeper/forked.rb
zookeeper-1.5.1 lib/zookeeper/forked.rb
zookeeper-1.5.0-java lib/zookeeper/forked.rb
zookeeper-1.5.0 lib/zookeeper/forked.rb
zookeeper-ng-1.5 lib/zookeeper/forked.rb
zookeeper-1.4.11 lib/zookeeper/forked.rb
zookeeper-1.4.11-java lib/zookeeper/forked.rb
zookeeper-1.4.10 lib/zookeeper/forked.rb
zookeeper-1.4.10-java lib/zookeeper/forked.rb
zookeeper-1.4.9 lib/zookeeper/forked.rb
zookeeper-1.4.9-java lib/zookeeper/forked.rb
zookeeper-1.4.8 lib/zookeeper/forked.rb