I want to make realtime change in HTML documents.
When the variable changed with event, HTTP document(.erb file) must automatically change together.
#controller.rb
puts("Downloading...")
bt = RubyTorrent::BitTorrent.new("public/files/ubuntu.torrent")
bt.on_event(self, :complete) { @donemessage="Done!" } #<-- This event
#index.html.erb
<h1>Transfers</h1>
<p><%= @donemessage %></p> <!-- <- This must be changed -->
How can I do that?
This is not an easy task at all. But generally the approach is following:
queue;queueresolver, after processing given (next) object in queue, should notify all subscribed client about the new status of object.Again, I cannot speak in details here as this is not that simple.
Take a look at the following projects to get more info on the topic: