- 
                Notifications
    
You must be signed in to change notification settings  - Fork 76
 
Closed
Description
Hi, Barry:
I appreciate this queue driver very much; it purports to be exactly what I need. I'm using it in a controller wherein I check if the exact zip/date combo of a request (movie showtimes) has been previously cached. If it has, I want to return the previously cached result, but still run the requested parameters again in the background to get updates. So, in this case ShowtimeController calls a queued job on itself.
The problem I'm having is it seems like execution of the (calling/original) controller is ending without error or stacktrace when the Queue::push line is executed. Also, the queue table has numerous jobs in it but they don't seem to be executing.
What am I missing?
Thank you,
~Todd
class ShowtimeController extends \BaseController {
    function getShowtimes($zipcode,$date) {
        $dateZipKey = $zipcode.'-'.$date;
        if (Cache::has($dateZipKey)) {
            Queue::push('ShowtimeController@showtimesJob', array('zipcode'=>$zipcode, 'date'=>$date));
            // ** I can step through with a debugger to this point, then the execution just stops. **
            $result = Cache::get($dateZipKey);
            return $result;
        } else {
            $result = $this->loadShowtimes($zipcode,$date);
        }
    }
    /* JOB for 'asynch' execution. */
    private function showtimesJob($job, $data)
    {
        $this->loadShowtimes($data['zipcode'],$data['date']);
        $job->delete();
    }
    /* Synchronous process for fetching and caching */
    private function loadShowtimes($mZipcode, $mDate)
    {
        // get the updated zip/date-based showtimes from external source and Cache::put($dateZipKey)
    }
}
Metadata
Metadata
Assignees
Labels
No labels