Closed tranluan91 closed 9 years ago
Hi,
The APP_INCLUDE
directive should be used to initialize your application in a way that it includes all of the necessary libraries for it to run - in the case of Laravel, this would be something specific to that which just sets up the framework (and includes Eloquent, etc) without trying to handle a web request.
You might be able to use something like this: https://github.com/ellisthedev/laravel-resque - it also seems to provide a console command (https://github.com/ellisthedev/laravel-resque/blob/master/src/Awellis13/Resque/Console/ListenCommand.php) for starting a worker, which you can either use or leverage for inspiration.
@chrisboulton thanks! I need use priorities for queue, so if I use laravel-resque, can I use priorities of PHP-resque?
My solution: app/queues.php
<?php
require __DIR__ . '/../bootstrap/autoload.php';
require_once __DIR__ . '/../bootstrap/start.php';
include 'models/User.php';
include 'services/BaseService.php';
include 'services/UserService.php';
include 'services/QueueService.php';
include 'services/GcmPushNotificationService.php';
And when need call something in model, I run a command of Laravel.
When I try use php-resque with Laravel 4.2, it's OK if I didn't use Model in resque I have try
Result:
app/queues.php
models/Users.php
Please help me! Thanks!