I''ve got some complex work to do and parts of it are heavy so I want to break it up into smaller jobs. What''s the best way for a worker to pass jobs off to other workers? Should we use MiddleMan or enqueue_task() ? I can''t find any docs on enqueue_task but if someone will point me in the right direction, I''ll gladly write it up and pass it on to Hemant for inclusion when I''ve got it working. thanks all
On Sat, Sep 13, 2008 at 6:33 PM, Rue Turner <rue at thinlayer.co.uk> wrote:> > I''ve got some complex work to do and parts of it are heavy so I want to break > it up into smaller jobs. > > What''s the best way for a worker to pass jobs off to other workers? > Should we use MiddleMan or enqueue_task() ? > > I can''t find any docs on enqueue_task but if someone will point me in the > right direction, I''ll gladly write it up and pass it on to Hemant for > inclusion when I''ve got it working. >I think, its here: http://backgroundrb.rubyforge.org/workers/ -- Let them talk of their oriental summer climes of everlasting conservatories; give me the privilege of making my own summer with my own coals. http://gnufied.org
MiddleMan object is certainly available in workers.Also, persistent_job is only available in worker, when task has been enqueued through enq_xxx method. Can you show the code, where you are trying to invoke the worker method using enq_xx?? On Mon, 2008-09-15 at 10:40 +0100, Rue Turner wrote:> > I think, its here: > > > > http://backgroundrb.rubyforge.org/workers/ > > Thanks Hermant. I did try those bits first but it seems MiddleMan isn''t > available from inside a worker. I also tried various way to enq_<worker> and > enqueue_ <worker> but still no luck. > > Also, persistent_job seems to return a nil object when calling ''finish!''. > > source: > http://pastie.org/272591 > log output: > http://pastie.org/272595 > > any help is really appreciated. > > Rue