Download the PHP package nilportugues/eventbus-queue without Composer

On this page you can find all versions of the php package nilportugues/eventbus-queue. 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 eventbus-queue

EventBus Queue

Build Status Scrutinizer Code Quality SensioLabsInsight Latest Stable Version Total Downloads License Donate

This package is an extension library for nilportugues/messagebus, adding queues to the EventBus implementation.

This package will provide you for the classes necessary to build:

Why?

It's all about deciding which command logic can be delayed, or hidden away in order to make it faster. And this is what we want to do.

You never remove a bottleneck, you just move it. The downside is that we might have to assume a possible delay.

Installation

In order to start using this project you require to install it using Composer:

Usage

This package will provide you with a new middleware: ProducerEventBusMiddleware.

This middleware requires a serializer and a storage that will depend on the Queue Adapter used. Supported adapters are:

To set it up, register the ProducerEventBusMiddleware to the Event Bus. Because we'll need to define a second EventBus (consumer), we'll call this the ProducerEventBus.

ProducerEventBus

Consumer for the ProducerEventBus

The Consumer will need to be a script that reads the EventBus definitions and subscribed events in order to run until all events are handled. To do so, we'll need to register a new EventBus we'll refer as ConsumerEventBus.

We will also like to store events that could not be handled or raised an exception. So a new Queue will be required. For instance, let's store errors in a MongoDB database.

This could be as simple as follows:

EventBusWorker

Finally, we'll have to call a consumer. This package already provides a fully working consumer implementation: EventBusWorker.

Use it as follows:

Consumer class will run the consume method until all events are consumed. Then it will exit. This is optimal to make sure it will not leak memory.

If you need to keep the consumer running forever use server scripts like Supervisor.

Supervisor Configuration

Supervisor is a process monitor for the Linux operating system, and will automatically restart your workers if they fail. To install Supervisor on Ubuntu, you may use the following command:

Supervisor configuration files are typically stored in the /etc/supervisor/conf.d directory. Within this directory, you may create any number of configuration files that instruct how your processes should be monitored.

For instance, let's create /etc/supervisor/conf.d/my_worker.conf so that it starts and monitors a worker script named my_worker.php:

In this file, we tell Supervisor that we want 20 instances always running. If the my_worker.php ends or fails it will spin up a new one.

In order to make this task run forever, you'll have to type in the following commands:

Adapter Configurations

PDOQueue

For this to work, you'll be required to create a table in your database.

For instance, sqlite dialect table creation would be:

MongoDBQueue

In order to use it, you require to install PHP 7's mongodb extension.

RedisQueue

In order to use it, you require to install PHP 7's phpredis extension.

PredisQueue

Nothing, but performs better if phpredis extension is found.

FileSystemQueue

Nothing to do.

AmqpQueue

Nothing to do other than having access to a amqp server.

Beanstalkd

Nothing to do other than having access to a beanstalkd server.

Contribute

Contributions to the package are always welcome!

Support

Get in touch with me using one of the following means:

Authors

License

The code base is licensed under the MIT license.


All versions of eventbus-queue with dependencies

PHP Build Version
Package Version
Requires php Version >=7
nilportugues/uuid Version ^1.0
nilportugues/messagebus Version ^1.1
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 nilportugues/eventbus-queue contains the following files

Loading the files please wait ....