Browse files

Implemented touch command.

  • Loading branch information...
1 parent f714870 commit b1660e54387f9a4f0909985d8ac1b65cc4b7a03d @dustin dustin committed Nov 19, 2008
Showing with 10 additions and 0 deletions.
  1. +5 −0 lib/beanstalk-client/connection.rb
  2. +5 −0 lib/beanstalk-client/job.rb
View
5 lib/beanstalk-client/connection.rb
@@ -117,6 +117,11 @@ def bury(id, pri)
:ok
end
+ def touch(id)
+ interact("touch #{id}\r\n", %w(TOUCHED))
+ :ok
+ end
+
def kick(n)
interact("kick #{n}\r\n", %w(KICKED))[0].to_i
end
View
5 lib/beanstalk-client/job.rb
@@ -65,6 +65,11 @@ def bury(newpri=nil)
@reserved = false
end
+ def touch
+ return if !@reserved
+ @conn.touch(id)
+ end
+
def stats()
@conn.job_stats(id)
end

0 comments on commit b1660e5

Please sign in to comment.