kr-beanstalk-client 1.0.0 → 1.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -74,9 +74,13 @@ module Beanstalk
|
|
|
74
74
|
interact("peek-buried\r\n", :job)
|
|
75
75
|
end
|
|
76
76
|
|
|
77
|
-
def reserve()
|
|
77
|
+
def reserve(timeout=nil)
|
|
78
78
|
raise WaitingForJobError if @waiting
|
|
79
|
-
|
|
79
|
+
if timeout.nil?
|
|
80
|
+
@socket.write("reserve\r\n")
|
|
81
|
+
else
|
|
82
|
+
@socket.write("reserve-with-timeout #{timeout}\r\n")
|
|
83
|
+
end
|
|
80
84
|
|
|
81
85
|
begin
|
|
82
86
|
@waiting = true
|
|
@@ -253,8 +257,8 @@ module Beanstalk
|
|
|
253
257
|
send_to_rand_conn(:yput, obj, pri, delay, ttr)
|
|
254
258
|
end
|
|
255
259
|
|
|
256
|
-
def reserve()
|
|
257
|
-
send_to_rand_conn(:reserve)
|
|
260
|
+
def reserve(timeout=nil)
|
|
261
|
+
send_to_rand_conn(:reserve, timeout)
|
|
258
262
|
end
|
|
259
263
|
|
|
260
264
|
def use(tube)
|