Is it really a hash? As in, can I pass it into a method that a worker is calling so that, for example, a method in my ActiveRecord that''s actually doing the work? Really liking the new code. Does rubyforge or devjavu have the rdocs anywhere? -- Joshua Warchol Code Poet, Zaadz Inc. http://joshua.zaadz.com/
* Joshua Warchol (joshua at zaadz.com) [061030 13:34]:> Is it really a hash? As in, can I pass it into a method that a worker is > calling so that, for example, a method in my ActiveRecord that''s > actually doing the work?if you want to be on the safe side, you might call results.to_hash, which should be ok. I''ve not tried to pass results itself to AR - please try it and report back how it behaves.> Really liking the new code. Does rubyforge or devjavu have the rdocs > anywhere?rdoc: http://backgroundrb.rubyforge.org /skaar -- ---------------------------------------------------------------------- |\|\ where in the | s_u_b_s_t_r_u_c_t_i_o_n | | >=========== W.A.S.T.E. | genarratologies |/|/ (_) is the wisdom | skaar at waste.org ----------------------------------------------------------------------
Ezra Zygmuntowicz
2006-Oct-30 21:01 UTC
[Backgroundrb-devel] Question about new results hash
On Oct 30, 2006, at 11:23 AM, Joshua Warchol wrote:> Is it really a hash? As in, can I pass it into a method that a > worker is > calling so that, for example, a method in my ActiveRecord that''s > actually doing the work? > > Really liking the new code. Does rubyforge or devjavu have the rdocs > anywhere? > > -- > Joshua Warchol > Code Poet, Zaadz Inc. > http://joshua.zaadz.com/Hey Joshua- ` I''m not entirely certain what you are asking? Can you clarify a bit please? The rdoc is here: http://backgroundrb.rubyforge.org/ Cheers- -- Ezra Zygmuntowicz -- Lead Rails Evangelist -- ez at engineyard.com -- Engine Yard, Serious Rails Hosting -- (866) 518-YARD (9273)
Ezra Zygmuntowicz
2006-Oct-30 21:24 UTC
[Backgroundrb-devel] Question about new results hash
On Oct 30, 2006, at 1:15 PM, Joshua Warchol wrote:> Ezra Zygmuntowicz wrote: >> I''m not entirely certain what you are asking? Can you clarify a >> bit please? > Well, I''ve got a model that''s currently doing the heavy lifting > populating entries in a few tables for a newsletter. I''m trying to > make it work with Backgroundrb now. So I''ve got a > Newsletter#deliver method that looks for subscribers and then > populates a notifications queue that another system uses to pump > out actual emails. > > Calling #deliver from a my PublishWorker is a snap, but I''m looking > at my options for reporting back its progress. Passing in the > results hash was my first idea. >> >> The rdoc is here: http://backgroundrb.rubyforge.org/ > I had the old README cached, sorry!Yes the results hash is really just a hash. But if you plan on getting results throughh the middleman and then passing them into your model the you should call MiddleMan.worker(session [:key]).results.to_hash before you pass them around on the rails side. The whole point of the results hash is to be able to pass hashes back and forth between rails and your workers. Take a look in the examples directory for all gthe stuff you need to set up an ajax progress bar. Cheers- -- Ezra Zygmuntowicz -- Lead Rails Evangelist -- ez at engineyard.com -- Engine Yard, Serious Rails Hosting -- (866) 518-YARD (9273)