Download the PHP package charliepage88/laravel-aws-worker without Composer

On this page you can find all versions of the php package charliepage88/laravel-aws-worker. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package laravel-aws-worker

laravel-aws-worker

Build Status Code Climate Total Downloads Latest Stable Version Latest Unstable Version License

Run Laravel (or Lumen) tasks and queue listeners inside of AWS Elastic Beanstalk workers

Credit

Package created by:

dusterio

Installation

Create a web beanstalk environment and a worker beanstalk environment.

Dependencies

Installation via Composer

To install simply run:

Worker

Configuring the queue

Every time you create a worker environment in AWS, you are forced to choose two SQS queues – either automatically generated ones or some of your existing queues. One of the queues will be for the jobs themselves, another one is for failed jobs – AWS calls this queue a dead letter queue.

You can set your worker queues either during the environment launch or anytime later in the settings:

AWS Worker queue settings

Don't forget to set the HTTP path to – this is where AWS will hit our application. If you chose to generate queues automatically, you can see their details later in SQS section of the AWS console:

AWS SQS details

You have to tell Laravel about this queue. First set your queue driver to SQS in file:

Then go to and copy/paste details from AWS console:

To generate key and secret go to Identity and Access Management in the AWS console. It's better to create a separate user that ONLY has access to SQS.

Notes

Create a cron.yaml file inside project root with following contents:

Inside of your .env file, set REGISTER_WORKER_ROUTES to true.

Update SQS config info to point to a different SQS queue than what the worker is using. During testing thus far, this has resulted in high accuracy of jobs being processed.

Do not have the scheduler run via cron, since the cron.yaml will take care of that.

Use supervisor to make sure the queue is running. When a job hits the worker, the queue will be necessary to enter the Job and process.

Web

Inside of your .env file, set REGISTER_WORKER_ROUTES to false.

Update SQS config info to point to created worker environment.

Do not have the scheduler run via cron and make sure the queue is set to sqs.

Use supervisor to make sure the queue is running and sending jobs to the worker beanstalk.

Errors and exceptions

Please make sure that two special routes are not mounted behind a CSRF middleware. Our POSTs are not real web forms and CSRF is not necessary here. If you have a global CSRF middleware, add these routes to exceptions, or otherwise apply CSRF to specific routes or route groups.

If your job fails, we will throw a . If you want to customize error output – just customise your exception handler. Note that your HTTP status code must be different from 200 in order for AWS to realize the job has failed.

TODO

  1. Add support for AWS dead letter queue (retry jobs from that queue?)

Implications

Note that AWS cron doesn't promise 100% time accuracy. Since cron tasks share the same queue with other jobs, your scheduled tasks may be processed later than expected.

Post scriptum

I wrote a blog post explaining how this actually works.


All versions of laravel-aws-worker with dependencies

PHP Build Version
Package Version
Requires php Version >=5.5.0
illuminate/support Version 5.*
illuminate/queue Version 5.*
illuminate/bus Version 5.*
aws/aws-sdk-php Version ~3.0
illuminate/http Version 5.*
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package charliepage88/laravel-aws-worker contains the following files

Loading the files please wait ....