Skip to content
Browse files

Added 'auth' function to send auth token.

  • Loading branch information...
1 parent 4e5e24e commit 1dbd6a1e7076509c243c89e281ede926b4820f42 @treeder committed Jul 16, 2011
Showing with 9 additions and 0 deletions.
  1. +9 −0 lib/beanstalk-client/connection.rb
View
9 lib/beanstalk-client/connection.rb
@@ -50,6 +50,11 @@ def close
@socket = nil
end
+ def auth(token)
+ interact("auth #{token}\r\n",
+ %w(OK))
+ end
+
def put(body, pri=65536, delay=0, ttr=120)
pri = pri.to_i
delay = delay.to_i
@@ -281,6 +286,10 @@ def last_server
@last_conn.addr
end
+ def auth(token)
+ send_to_all_conns(:auth, token)
+ end
+
# Put a job on the queue.
#
# == Parameters:

0 comments on commit 1dbd6a1

Please sign in to comment.
Something went wrong with that request. Please try again.