Permalink
Browse files

Moved overrides into single file to make it easy to see what's been c…

…hanged.
  • Loading branch information...
1 parent 1dbd6a1 commit ab2bd95fcc25671c26e32117ab1a1b91bc506b43 @treeder committed Aug 1, 2011
Showing with 21 additions and 5 deletions.
  1. +20 −0 lib/beanstalk-client.rb
  2. +0 −5 lib/beanstalk-client/connection.rb
  3. +1 −0 lib/beanstalk-client/job.rb
View
@@ -26,3 +26,23 @@ module Beanstalk
require 'beanstalk-client/connection'
require 'beanstalk-client/errors'
require 'beanstalk-client/job'
+
+# overrides for IronMQ
+
+module Beanstalk
+ class Connection
+
+ def auth(token)
+ interact("auth #{token}\r\n",
+ %w(OK))
+ end
+
+ def read_job(word)
+ id, bytes = check_resp(word) #.map { |s| s.to_i }
+ bytes = bytes.to_i
+ body = read_bytes(bytes)
+ raise 'bad trailer' if read_bytes(2) != "\r\n"
+ [id, body, word == 'RESERVED']
+ end
+ end
+end
@@ -50,11 +50,6 @@ 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
@@ -41,6 +41,7 @@ def initialize(conn, id, body, reserved=true)
@id = id
@body = body
@reserved = reserved
+ #p self
end
# Deletes the job from the queue

0 comments on commit ab2bd95

Please sign in to comment.