Skip to content

Commit

Permalink
Support new tube commands.
Browse files Browse the repository at this point in the history
  • Loading branch information
Keith Rarick committed Feb 27, 2008
1 parent fb97c66 commit 01ee7bd
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions lib/beanstalk-client/connection.rb
Expand Up @@ -91,6 +91,21 @@ def bury(id, pri)
:ok
end

def use(tube)
@socket.write("use #{tube}\r\n")
check_resp('USING')[0]
end

def watch(tube)
@socket.write("watch #{tube}\r\n")
check_resp('WATCHING')[0]
end

def ignore(tube)
@socket.write("ignore #{tube}\r\n")
check_resp('WATCHING')[0]
end

def stats()
@socket.write("stats\r\n")
read_yaml('OK')
Expand Down Expand Up @@ -250,6 +265,18 @@ def reserve()
send_to_rand_conn(:reserve)
end

def use(tube)
send_to_all_conns(:use, tube)
end

def watch(tube)
send_to_all_conns(:watch, tube)
end

def ignore(tube)
send_to_all_conns(:ignore, tube)
end

def raw_stats()
send_to_all_conns(:stats)
end
Expand Down

0 comments on commit 01ee7bd

Please sign in to comment.