2017 © Pedro Peláez
 

library interlude

Emulated timeouts for synchronous operations.

image

icecave/interlude

Emulated timeouts for synchronous operations.

  • Monday, November 10, 2014
  • by jmalloc
  • Repository
  • 3 Watchers
  • 4 Stars
  • 17,052 Installations
  • PHP
  • 1 Dependents
  • 0 Suggesters
  • 0 Forks
  • 1 Open issues
  • 3 Versions
  • 7 % Grown

The README.md

Interlude

![Build Status] ![Test Coverage] ![SemVer], (*1)

Interlude is a small PHP library for repeating a non-blocking operation until it succeeds, a timeout period is reached, or a maximum number of attempts have been performed., (*2)

If you don't need the timeout feature, you might want to try igorw/retry., (*3)

Example

use Icecave\Interlude\Exception\AttemptsExhaustedException;
use Icecave\Interlude\Exception\TimeoutException;
use Icecave\Interlude\Invoker;

$invoker = new Invoker;

$operation = function ($remainingTimeout, $remainingAttempts) {
    // do work ...
};

try {
    $invoker->invoke(
        $operation,
        10, // ten second timeout
        3   // maximum of three attempts
    );
} catch (TimeoutException $e) {
    echo 'The operation timed out!' . PHP_EOL;
} catch (AttemptsExhaustedException $e) {
    echo 'The operation was attempted the maximum number of times!' . PHP_EOL;
}

Contact us

The Versions

10/11 2014

dev-develop

dev-develop https://github.com/IcecaveStudios/interlude

Emulated timeouts for synchronous operations.

  Sources   Download

MIT

The Requires

 

The Development Requires

async retry sync repeat timeout ttl

10/11 2014

dev-master

9999999-dev https://github.com/IcecaveStudios/interlude

Emulated timeouts for synchronous operations.

  Sources   Download

MIT

The Requires

 

The Development Requires

async retry sync repeat timeout ttl

10/11 2014

0.1.0

0.1.0.0 https://github.com/IcecaveStudios/interlude

Emulated timeouts for synchronous operations.

  Sources   Download

MIT

The Requires

 

The Development Requires

async retry sync repeat timeout ttl