lib/kestrel/client.rb in kestrel-client-0.4.0 vs lib/kestrel/client.rb in kestrel-client-0.4.1

- old
+ new

@@ -32,9 +32,31 @@ commands = extract_queue_commands(opts) super key + commands, raw end + # ==== Parameters + # key<String>:: Queue name + # opts<Boolean,Hash>:: True/false toggles Marshalling. A Hash + # allows collision-avoiding options support. + # + # ==== Options (opts) + # :open<Boolean>:: Begins a reliable read. + # :close<Boolean>:: Ends a reliable read. + # :abort<Boolean>:: Cancels an existing reliable read + # :peek<Boolean>:: Return the head of the queue, without removal + # :timeout<Integer>:: Milliseconds to block for a new item + # :raw<Boolean>:: Toggles Marshalling. Equivalent to the "old + # style" second argument. + # + def get_from_last(key, opts = {}) + opts = extract_options(opts) + raw = opts.delete(:raw) + commands = extract_queue_commands(opts) + + super key + commands, raw + end + def flush(queue) count = 0 while sizeof(queue) > 0 while get queue, :raw => true count += 1