# File lib/sup/index.rb, line 85 def add_message m; unimplemented end
Load message with the given message-id from the index
# File lib/sup/index.rb, line 131 def build_message id unimplemented end
# File lib/sup/index.rb, line 97 def contains? m; contains_id? m.id end
# File lib/sup/index.rb, line 93 def contains_id? id unimplemented end
Delete message with the given message-id from the index
# File lib/sup/index.rb, line 136 def delete id unimplemented end
Yield each message-id matching query
# File lib/sup/index.rb, line 147 def each_id query={} unimplemented end
Yields a message-id and message-building lambda for each message that matches the given query, in descending date order. You should probably not call this on a block that doesn't break rather quickly because the results can be very large.
# File lib/sup/index.rb, line 109 def each_id_by_date query={} unimplemented end
Yield each message matching query
# File lib/sup/index.rb, line 152 def each_message query={}, &b each_id query do |id| yield build_message(id) end end
yield all messages in the thread containing 'm' by repeatedly querying the index. yields pairs of message ids and message-building lambdas, so that building an unwanted message can be skipped in the block if desired.
only two options, :limit and :skip_killed. if :skip_killed is true, stops loading any thread if a message with a :killed flag is found.
# File lib/sup/index.rb, line 126 def each_message_in_thread_for m, opts={} unimplemented end
# File lib/sup/index.rb, line 26 def is_a_deprecated_ferret_index?; false end
# File lib/sup/index.rb, line 69 def load SourceManager.load_sources load_index end
Given an array of email addresses, return an array of Person objects that have sent mail to or received mail from any of the given addresses.
# File lib/sup/index.rb, line 142 def load_contacts email_addresses, h={} unimplemented end
# File lib/sup/index.rb, line 81 def load_index unimplemented end
# File lib/sup/index.rb, line 39 def lock debug "locking #{lockfile}..." begin @lock.lock rescue Lockfile::MaxTriesLockError raise LockError, @lock.lockinfo_on_disk end end
# File lib/sup/index.rb, line 37 def lockfile; File.join @dir, "lock" end
Return the number of matches for query in the index
# File lib/sup/index.rb, line 114 def num_results_for query={} unimplemented end
Implementation-specific optimization step
# File lib/sup/index.rb, line 159 def optimize unimplemented end
parse a query string from the user. returns a query object that can be passed to any index method with a 'query' argument.
raises a ParseError if something went wrong.
# File lib/sup/index.rb, line 176 def parse_query s unimplemented end
# File lib/sup/index.rb, line 202 def run_sync_worker while m = @sync_queue.deq return if m == :die update_message_state m # Necessary to keep Xapian calls from lagging the UI too much. sleep 0.03 end end
# File lib/sup/index.rb, line 74 def save debug "saving index and sources..." FileUtils.mkdir_p @dir unless File.exists? @dir SourceManager.save_sources save_index end
# File lib/sup/index.rb, line 89 def save_index fn unimplemented end
# File lib/sup/index.rb, line 180 def save_thread t t.each_dirty_message do |m| if @sync_worker @sync_queue << m else update_message_state m end m.clear_dirty end end
Return the id source of the source the message with the given message-id was synced from
# File lib/sup/index.rb, line 165 def source_for_id id unimplemented end
# File lib/sup/index.rb, line 48 def start_lock_update_thread @lock_update_thread = Redwood::reporting_thread("lock update") do while true sleep 30 @lock.touch_yourself end end end
# File lib/sup/index.rb, line 191 def start_sync_worker @sync_worker = Redwood::reporting_thread('index sync') { run_sync_worker } end
# File lib/sup/index.rb, line 57 def stop_lock_update_thread @lock_update_thread.kill if @lock_update_thread @lock_update_thread = nil end
# File lib/sup/index.rb, line 195 def stop_sync_worker return unless worker = @sync_worker @sync_worker = nil @sync_queue << :die worker.join end
# File lib/sup/index.rb, line 62 def unlock if @lock && @lock.locked? debug "unlocking #{lockfile}..." @lock.unlock end end
Generated with the Darkfish Rdoc Generator 2.