Sunday, June 2, 2013

[Rails] sidekiq: push background results to front

Rails 3.2.11
Sidekiq latest

My app continues background jobs that generate texts as the output.

class ProcessText
include Sidekiq::Worker

def perform(name, count)
puts "executing..."
@feed = Feed.first
@feed.process # here it returns String results!
end
end


What I want is basically how to send (or push?) the result texts to a
particular web page.

The above function 'perform' is in app/workers directory, as instructed
in the documentation of Sidekiq. It must be simple but I am unable to
find the way to do it yet.
Somehow I need to let a controller reload the page, OR with the help of
jquery ajax, to show the results, I guess?

Could anyone give me tips?

soichi

--
Posted via http://www.ruby-forum.com/.

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/903eeb9bf373921c0cade5ca14980eac%40ruby-forum.com?hl=en-US.
For more options, visit https://groups.google.com/groups/opt_out.

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home


Real Estate