morris / sync
Synchronized function calls for PHP
Installs: 2 840
Dependents: 0
Suggesters: 0
Security: 0
Stars: 4
Watchers: 2
Forks: 1
Open Issues: 0
Requires
- php: >=5.3.0
Requires (Dev)
- phpunit/phpunit: 3.7.*
This package is auto-updated.
Last update: 2024-12-09 02:21:28 UTC
README
<?php // Call a function in a mutually exclusive way using a lockfile. // A process will only block other processes and never block itself, // so you can safely nest synchronized operations. Sync::call( function() { // do critical stuff like IO here } ); // Set default lockfile Sync::$lock = 'my/default/.lock'; // Use different lockfile by passing it as the second argument Sync::call( $func, 'my/other/.lock' );
Requirements
- PHP 5.3+
Installation
The composer package name is morris/sync
. You can also download or
fork the repository.
License
Sync is licensed under the MIT License. See LICENSE.md
for details.