Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions lib/ost.rb
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,18 @@ def stop
@stopping = true
end

def pop_item(value, occurrences)
redis.call("LREM", @key, occurrences, value)
end

def pop_first
redis.call("LPOP", @key)
end

def pop_last
redis.call("RPOP", @key)
end

def items
redis.call("LRANGE", @key, 0, -1)
end
Expand Down