Class: Webmachine::Trace::PStoreTraceStore
- Inherits:
-
Object
- Object
- Webmachine::Trace::PStoreTraceStore
- Defined in:
- lib/webmachine/trace/pstore_trace_store.rb
Overview
Implements a trace storage using PStore from Ruby's standard
library. To use this trace store, specify the :pstore engine
and a path where it can store traces:
Instance Method Summary (collapse)
-
- (Object) []=(key, trace)
Private
Records a trace in the store.
-
- (Array) fetch(key)
Private
Fetches a trace from the store.
-
- (PStoreTraceStore) initialize(path)
constructor
Private
A new instance of PStoreTraceStore.
-
- (Array) keys
Private
Lists the recorded traces.
Constructor Details
- (PStoreTraceStore) initialize(path)
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
A new instance of PStoreTraceStore
13 14 15 |
# File 'lib/webmachine/trace/pstore_trace_store.rb', line 13 def initialize(path) @pstore = PStore.new(path) end |
Instance Method Details
- (Object) []=(key, trace)
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Records a trace in the store
34 35 36 |
# File 'lib/webmachine/trace/pstore_trace_store.rb', line 34 def []=(key, trace) @pstore.transaction { @pstore[key] = trace } end |
- (Array) fetch(key)
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Fetches a trace from the store
28 29 30 |
# File 'lib/webmachine/trace/pstore_trace_store.rb', line 28 def fetch(key) @pstore.transaction(true) { @pstore[key] } end |
- (Array) keys
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Lists the recorded traces
20 21 22 |
# File 'lib/webmachine/trace/pstore_trace_store.rb', line 20 def keys @pstore.transaction(true) { @pstore.roots } end |