phpgroupware-developers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: [Phpgroupware-developers] async service question


From: Dirk Schaller
Subject: RE: [Phpgroupware-developers] async service question
Date: Wed, 28 Apr 2004 14:55:42 +0200

Okay the prefs should be a workaround.

I analysed the async stuff a little bit more and saw whats happens
when running an async execution:
After executing the method the async process overwrites the changes
I mad with async->write() during the execution.

The trick is to read the async data after the execution again. I do
this in method check_run() after ExecMethod(). So the async process
can considers the modifications and save the data correctly.

$updated_jobs = $this->read($id);
if (is_array($updated_jobs) && isset($updated_jobs[$id]))
{
        $job['data'] = $updated_jobs[$id]['data'];
}
$this->write($job,True);

I made this little patch for this and put them on savannah.
<http://savannah.gnu.org/patch/?func=detailitem&item_id=2986>

Can someone check this please? Im not sure if such a change has
effekts to other applications, who uses async too. Some hints?
In my view there should be no problems because I only update the
data, not the complete job. So no calculated times are concerned.

Comments are welcome.
Dirk



> -----Original Message-----
> From: Dave Hall [mailto:address@hidden
> Sent: Wednesday, April 28, 2004 6:20 PM
> To: address@hidden
> Subject: Re: [Phpgroupware-developers] async service question
> 
> 
> Hey Dirk
> 
> On Wed, 2004-04-28 at 07:51, Dirk Schaller wrote:
> > Hi,
> > 
> > does anyone knows how can I update the async date
> > during an async execution?
> > 
> > I want save the time of the async execution in the
> > data field for use them in the next async execution.
> 
> Hmmmm.  I am far from an expert on the async code.
> 
> You could store it as a "hidden pref" for the user.
> 
> using something like this (please check the src)
> 
> <code type="from memory">
> if(!is_object($GLOBALS['phpgw']->prefs))
> {
>       $GLOBALS['phpgw']->prefs = createObject('phpgwapi.preferences');
> }
> 
> $GLOBALS['phpgw']->prefs->read_repository();
> $GLOBALS['phpgw']->prefs->data['async']['last_run'] = time();
> $GLOBALS['phpgw']->prefs->save_repository();
> </code>
> 
> Cheers
> 
> Dave
> 
> 
> 
> _______________________________________________
> Phpgroupware-developers mailing list
> address@hidden
> http://mail.gnu.org/mailman/listinfo/phpgroupware-developers
> 




reply via email to

[Prev in Thread] Current Thread [Next in Thread]