Download the PHP package fabiomsouto/phuse without Composer

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

Phuse - A no-frills fuse implementation for PHP

This applications implements fuses for PHP. Right now it offers an APC-backed unsafe fuse. It is greatly inspired by jlouis' implementation of fuses in erlang, which you can find here.

Build Status

Installation

Instalation is as simple as running

Changelog

This project follows semantic versioning.

2.0.0

[Changed]

1.1.0

[Added]

[Changed]

1.0.1

[Added]

[Changed]

1.0.0

[Added]

[Changed]

0.0.1

[Added]

What is a fuse?

A fuse is a component that short-circuits internally after melting, similarly to a real life fuse.

What can it do for me?

A fuse can help your application be more reliable when it needs to communicate with external systems. Let's say that your application A communicates with an application B. If B starts timing out, or throwing errors, how would your application behave? Specifically in the case of PHP, if you have a REST service, and it needs to synchronously hit an external endpoint, latencies in the external service will cause your own service to have increased latencies, locking up your workers, etc. A fuse can sit in between. Whenever you detect a fault, you melt your fuse. After a number of melts, the fuse blows, and it will not contact your service for a while, breaking this dependency chain. Your service can then fail a lot faster, or react accordingly (by contacting a backup service for example).

How do I use a fuse (tutorial)?

Easy peasy. Start by instantiating a fuse:

This will setup a fuse, named database. $M is the number of melts the fuse can withstand until it melts. $T is the time interval during which these melts can occur. So in this case, if 10 melts happen in 100ms, the fuse blows. After the fuse blows, it will only restart after $R ms, in this case 1000ms.

After your fuse is setup, your app can ask about its state:

This is the happy situation. But now let's say that you're doing a POST to some endpoint, and it errors out:

You're signaling the fuse that something's wrong. If the fuse melts too many times in a certain time frame, it blows, and stays that way until it cools down.

How do I monitor the fuses?

Every fuse that inherits from the Fuse interface is also an SplSubject. As such, you can create a SplObserver and register it along the fuse. Each time the fuse blows or restarts, the Observer will be notified:

Keep in mind, notifying observers can take a long time. As such, keep the update call lean and make sure you're not registering a lot of observers in each fuse, as notifying all of them is an O(n) operation.

Performance

This will be available soon.

Tests

Some PHPUnit tests are provided. If you want to contribute, make sure to provide unit tests for your contributions.


All versions of phuse with dependencies

PHP Build Version
Package Version
Requires symfony/polyfill-apcu Version ^1.7.0
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 fabiomsouto/phuse contains the following files

Loading the files please wait ....