Refactor code to resolve jobs in WAIT_ASYNC into JQManagedJob. Add tests...

....
true dat. think i should make an interface for it?

On Oct 6, 2014, at 11:18 AM, Loren Norman <notifications@github.com> wrote:

> In src/JQJobs/JQManagedJob.php:
> 
> > +    {
> > +        // load job WITH MUTEX
> > +        $mJob = $q->getWithMutex($jobId);
> > +        if ($mJob->getStatus() !== JQManagedJob::STATUS_WAIT_ASYNC)
> > +        {
> > +            throw new JQManagedJob_InvalidStateException;
> > +        }
> > +
> > +        // wrap so we can "finally" the clearMutex()
> > +        try {
> > +            // allow the job to process the async data update
> > +            $err = NULL;
> > +            try {
> > +                $disposition = ErrorManager::wrap(array($mJob->getJob(), 'resolveWaitAsyncJob'), array($data), array($mJob, 'errorHandlerFailJob'));
> > +            } catch (Exception $e) {
> > +                if ($convertExceptionToFailure)
> Somewhere in here we might want to catch the fact that a Job doesn't even have a resolveWaitAsync() function. There should probably be an explicit exception code path for that.
> 
> —
> Reply to this email directly or view it on GitHub.
>