FoxxMD / laravel-elasticbeanstalk-queue-worker

MIT License
52 stars 13 forks source link

Documentation Example #11

Closed MCKLtech closed 5 years ago

MCKLtech commented 5 years ago

Would it be possible to expand the documentation with respect to :

queue[QueueName] = [queueName] [QueueName]NumProcs = [value] [QueueName]Tries = [value] [QueueName]Sleep = [value] [QueueName]StartSecs = [value] [QueueName]Delay = [value]

For example, is the default queue defined as:

queuedefault = default

?

FoxxMD commented 5 years ago

The configuration parser generates a queue:work command one of two ways based on what value is present for the environmental variable queue_driver (not case-sensitive). I wrote the parser this way because I mainly use beanstalkd and this satisfied my use case at the time:

queue_driver = beanstalkd

The command generated uses beanstalkd as the connection argument and value of the queue variable as the queue option.

EX Environmental variables:

queuedefault = default
queue_driver = beanstalkd

Generated command: php artisan queue:work beanstalkd --queue=default --tries=5 --sleep=5 --delay=0 --daemon

queue_driver is not present or not equal to beanstalkd

The command generated uses the value of the queue variable as the connection argument

EX Environmental variables:

queuedefault = default
queue_driver = sqs

Generated command: php artisan queue:work default --tries=5 --sleep=5 --delay=0 --daemon


I realize this doesn't provide the same kind of functionality for non-beanstalk connections since you can't specify queue. Also it doesn't use the queue.php config file to determine the default connection, which it probably should.

But since this library is literally just copying the .ebextensions folder to your project its trivial to modify the parser yourself if its not suiting your needs. Or you can just write your own supervisord.conf.

Does that answer your question?

MCKLtech commented 5 years ago

Thank you for the answer, it is clearer now.