1
0
mirror of https://github.com/danog/parallel.git synced 2024-12-04 02:27:55 +01:00
parallel/src/Sync/SemaphoreInterface.php

19 lines
411 B
PHP
Raw Normal View History

<?php
namespace Icicle\Concurrent\Sync;
/**
* A counting semaphore interface.
*
* Objects that implement this interface should guarantee that all operations
* are atomic.
*/
interface SemaphoreInterface
{
/**
* Acquires a lock from the semaphore asynchronously.
*
* @return \Icicle\Promise\PromiseInterface<Lock> A promise resolved with a lock.
*/
public function acquire();
}