Hi Hemant, You are writing:
"When a task is pulled out of queue, its flagged as taken and you can specify a timeout period while creating a task. When you invoke "#finish!" task is marked finished. There is no, "error", because, if you a task is "taken" and not "finished!" within specified period, its automatically considered in error state." I am wondering what will happen with the task that was somehow shutdown after it was marked "taken" but before it was marked "finished". Will it be redone ? When ? Thank you and best regards, Marcin Zduniak Mobile Technology Lab, www.mobtechlab.com Private: www.zduniak.com ---------- Forwarded message ---------- From: hemant <[EMAIL PROTECTED]> Date: Thu, Jul 17, 2008 at 2:36 PM Subject: Re: [Backgroundrb-devel] best approach to managing workers and getting status To: Frank Schwach <[EMAIL PROTECTED]> On Thu, Jul 17, 2008 at 1:46 PM, Frank Schwach <[EMAIL PROTECTED]> wrote: > Thanks Hemant, > > Yes, I saw the part about the persistent job queue but I have a couple > of questions about this: > > What does the table for the job queue look like? > You can open mysql or whatever db you are using and run: desc bdrb_job_queues; to see, whats the schema of the table. > How do I set other states of the job like "error"? Is the job status > changed from "pending" to "running" automatically in the table so that I > can query this table for pending/running/completed jobs? When a task is pulled out of queue, its flagged as taken and you can specify a timeout period while creating a task. When you invoke "#finish!" task is marked finished. There is no, "error", because, if you a task is "taken" and not "finished!" within specified period, its automatically considered in error state. > > Can I get the jobs ID from within the worker so that I can update the > job queue table "manually" too? If I want to record a "percentage > completion" I guess I would need that. Sure, from anywhere in your worker code, you can use, 'persistent_job' attribute to get task thats dequed from job queue and is currently running. > Can I specify the (remote) host with enq_some_job like I can with the > async_enque_job method? You can't, because for persistent tasks, it doesn't matter, the worker which fetches the task first, gets to execute it anyway. -- 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 _______________________________________________ Backgroundrb-devel mailing list [email protected] http://rubyforge.org/mailman/listinfo/backgroundrb-devel
