Skip to content

Commit

Permalink
Added statuses polling
Browse files Browse the repository at this point in the history
  • Loading branch information
Adam Holt authored and quirkey committed Jul 12, 2010
1 parent 4f10c31 commit 717f387
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 1 deletion.
2 changes: 2 additions & 0 deletions lib/resque/server/views/statuses.erb
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@
<% end %>
</table>

<%= poll %>

<script type="text/javascript" charset="utf-8">
jQuery(function($) {

Expand Down
8 changes: 8 additions & 0 deletions lib/resque/status_server.rb
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,14 @@ def self.registered(app)
redirect url(:statuses)
end

app.get "/statuses.poll" do
content_type "text/plain"
@polling = true

@statuses = Resque::Status.statuses
status_view(:statuses, {:layout => false})
end

app.helpers do
def status_view(filename, options = {}, locals = {})
erb(File.read(File.join(VIEW_PATH, "#{filename}.erb")), options, locals)
Expand Down
2 changes: 1 addition & 1 deletion resque-status.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Gem::Specification.new do |s|

s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
s.authors = ["Aaron Quint"]
s.date = %q{2010-06-06}
s.date = %q{2010-07-07}
s.description = %q{resque-status is an extension to the resque queue system that provides simple trackable jobs. It provides a Resque::Status class which can set/get the statuses of jobs and a Resque::JobWithStatus class that when subclassed provides easily trackable/killable jobs.}
s.email = %q{aaron@quirkey.com}
s.extra_rdoc_files = [
Expand Down

0 comments on commit 717f387

Please sign in to comment.