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

23 lines
428 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
{
/**
* @coroutine
*
* Acquires a lock from the semaphore asynchronously.
*
* @return \Generator
*
* @resolve \Icicle\Concurrent\Sync\Lock
*/
public function acquire();
}