Download the PHP package stratadox/observation-queue without Composer

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

Observation Queue

Build Status Coverage Status Scrutinizer Code Quality

Safeguard for observers to prevent problems in the invocation order.

Installation

Install using composer:

composer require stratadox/observation-queue

Why use this?

Use this if you have situations where observers and observables are heavily used.

Observers, by default, come with a few pretty tricky gotcha's. Reentry, for instance, may cause bugs that can get pretty difficult to find.

Example

Let's take a look at the following scenario:

What happens here?

Since Observer A got registered to Foo before Observer B got registered, Observer A is updated first. Updating Observer A triggers Bar, which in turn leads to Bar updating its subscribers.

Makes sense for far, right? But here's the tricky part: At this point, Foo has not yet updated Observer B!

Of course, Observer B will eventually get updated by Foo. But only after receiving the update from Bar.

The alternative

In situations where an Observer can trigger an update to an Observable, and the execution order of the relevant observers is of some importance, it may be wise to use the ObservationQueue.

The ObservationQueue is a queue of all the messages that still need to be sent to the observers. Observables add their items to the queue, and proceed to trigger the execution of the queue.

Due to this queueing layer, observer notifications are processed in the order in which the observables got triggered.

What's the price?

Although the monetary price of the software is zero, using this mechanism does introduce some shared mutable state. In order for the queue to have any effect, multiple observables need to be given access.

Basic use

Normally, updating the subscribers of an Observable would go roughly like this:

When using an observation queue, instead use:


All versions of observation-queue with dependencies

PHP Build Version
Package Version
Requires php Version >=7.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 stratadox/observation-queue contains the following files

Loading the files please wait ....