Skip to content

Instantly share code, notes, and snippets.

@tobstarr
Created July 24, 2012 14:30
Show Gist options
  • Save tobstarr/3170225 to your computer and use it in GitHub Desktop.
Save tobstarr/3170225 to your computer and use it in GitHub Desktop.
require "redis"
Redis.current.del("test")
def do_set!
did_set = nil
Redis.current.pipelined do
did_set = Redis.current.setnx("test", "ja")
Redis.current.expire("test", 3600)
end
did_set.value
end
p do_set!
p do_set!
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment