waitpid2

Process.waitpid2(pid=-1, flags=0) â [pid, status] Class Public methods Waits for a child process to exit (see ::waitpid for exact semantics) and returns an array containing the process id and the exit status (a Process::Status object) of that child. Raises a SystemCallError if there are no child processes. Process.fork { exit 99 } #=> 27437 pid, status = Process.wait2 pid #=> 27437 status.exitstatus #=> 99

print_profile

print_profile(f) Instance Public methods

start_profile

start_profile() Instance Public methods

stop_profile

stop_profile() Instance Public methods

new

new(file, thread_safe = false) Class Public methods To construct a PStore object, pass in the file path where you would like the data to be stored. PStore objects are always reentrant. But if thread_safe is set to true, then it will become thread-safe at the cost of a minor performance hit.

[]

[](name) Instance Public methods Retrieves a value from the PStore file data, by name. The hierarchy of Ruby objects stored under that root name will be returned. WARNING: This method is only valid in a #transaction. It will raise PStore::Error if called at any other time.

[]=

[]=(name, value) Instance Public methods Stores an individual Ruby object or a hierarchy of Ruby objects in the data store file under the root name. Assigning to a name already in the data store clobbers the old data. Example: require "pstore" store = PStore.new("data_file.pstore") store.transaction do # begin transaction # load some data into the store... store[:single_object] = "My data..." store[:obj_heirarchy] = { "Kev Jackson" => ["rational.rb", "pstore.rb"],

abort

abort() Instance Public methods Ends the current #transaction, discarding any changes to the data store. Example: require "pstore" store = PStore.new("data_file.pstore") store.transaction do # begin transaction store[:one] = 1 # this change is not applied, see below... store[:two] = 2 # this change is not applied, see below... store.abort # end transaction here, discard all changes store[:three] = 3 # this change is never reached end WARNING: This me

commit

commit() Instance Public methods Ends the current #transaction, committing any changes to the data store immediately. Example: require "pstore" store = PStore.new("data_file.pstore") store.transaction do # begin transaction # load some data into the store... store[:one] = 1 store[:two] = 2 store.commit # end transaction here, committing changes store[:three] = 3 # this change is never reached end WARNING: This method is only valid in a #transaction. It wil

delete

delete(name) Instance Public methods Removes an object hierarchy from the data store, by name. WARNING: This method is only valid in a #transaction and it cannot be read-only. It will raise PStore::Error if called at any other time.