Permalink
Browse files

Added more information about what is going on.

  • Loading branch information...
treeder committed Dec 15, 2011
1 parent 17e105d commit 34caf190b9b780bda2ebaa7018e9540ec627ca4c
Showing with 32 additions and 2 deletions.
  1. +3 −0 hello.rb
  2. BIN static/images/ajax-loader.gif
  3. +29 −2 views/hello.erb
View
@@ -44,6 +44,9 @@
get '/' do
+ if session[:worker_id]
+ @running = true
+ end
@msg = settings.ironmq.messages.get(:queue_name=>settings.queue_name)
@msg.delete if @msg
erb :hello
Binary file not shown.
View
@@ -103,6 +103,18 @@
<h1><a href="http://www.iron.io" id="main">Powered by Iron.io</a></h1>
+ <p>
+ This is an example application that uses <a href="http://www.iron.io/products/mq">IronMQ</a>
+ and <a href="http://www.iron.io/products/worker">IronWorker</a> together. If you click
+ the &quot;Run TweetWorker&quot; button below, that will queue up a
+ <a href="https://github.com/iron-io/heroku_sinatra_example/blob/master/workers/tweet_worker.rb">TweetWorker</a> task
+ on IronWorker. TweetWorker is a worker that gets the latest tweet tagged with #cloud and push that
+ tweet onto a queue on IronMQ.
+ <br/><br/>
+ This page you are looking at grabs tweets off the same queue on IronMQ and displays them. To see
+ more tweets, keep running TweetWorker.
+ </p>
+
<div>
<% if @msg %>
Latest Tweet:
@@ -136,6 +148,7 @@
keep_going = true;
} else {
keep_going = false;
+ $("#status_indicator").hide();
}
})
// .success(function() { alert("second success"); })
@@ -148,13 +161,27 @@
return keep_going;
});
</script>
- <div id="status_div">
+ <div id="status_container" style="display: none;">
+ <div id="status_indicator" style="display: inline-block; width: 40px;">
+ <img src="/images/ajax-loader.gif"/>
+ </div>
+ <div id="status_div">
+ </div>
</div>
+ <script>
+ <% if @running %>
+ $("#status_container").show();
+ <% else %>
+ $("#status_container").hide();
+ <% end %>
+ </script>
+
<div class="footer">
- Source code for this project is on <a href="https://github.com/iron-io/heroku_sinatra_example" target="_blank">Github</a>
+ Source code for this project is on
+ <a href="https://github.com/iron-io/heroku_sinatra_example" target="_blank">Github</a>
</div>
</div>

0 comments on commit 34caf19

Please sign in to comment.