Lock
in package
Lock class
Table of Contents
Constants
- MAX_RETRIES = 10
- REQUEST_ALREADY_PERFORMED = 300
- REQUEST_PERFORMED = 200
- RESOURCED_ARE_LOCKED = 400
- SLEEP_SECS = 30
Properties
- $authUrl : string
- $lockUrl : string
- $resourceLocked : bool
- $response : array<string|int, mixed>
Methods
- __construct() : mixed
- on __construct automatically try to lock resources
- __destruct() : mixed
- on __destruct automatically try to release resources
- acquire() : bool
- Try to lock CollettoreUnico reources
- release() : bool
- Release CollettoreUnico resources
- fetch() : bool
- Connect to CollettoreUnico and request/release lock
Constants
MAX_RETRIES
private
mixed
MAX_RETRIES
= 10
REQUEST_ALREADY_PERFORMED
private
mixed
REQUEST_ALREADY_PERFORMED
= 300
REQUEST_PERFORMED
private
mixed
REQUEST_PERFORMED
= 200
RESOURCED_ARE_LOCKED
private
mixed
RESOURCED_ARE_LOCKED
= 400
SLEEP_SECS
private
mixed
SLEEP_SECS
= 30
Properties
$authUrl
private
string
$authUrl
= ''
$lockUrl
private
string
$lockUrl
= ''
$resourceLocked
private
bool
$resourceLocked
= false
$response
private
array<string|int, mixed>
$response
= array()
Methods
__construct()
on __construct automatically try to lock resources
public
__construct(string $proto, string $fqdn, int $port, string $auth) : mixed
Parameters
- $proto : string
- $fqdn : string
- $port : int
- $auth : string
__destruct()
on __destruct automatically try to release resources
public
__destruct() : mixed
acquire()
Try to lock CollettoreUnico reources
public
acquire() : bool
Return values
bool —TRUE if lock is acquired, false otherwise
release()
Release CollettoreUnico resources
public
release() : bool
Return values
bool —TRUE if lock is release, false otherwise
fetch()
Connect to CollettoreUnico and request/release lock
private
fetch() : bool
Return values
bool —TRUE if request action is done and => $response property is set, false otherwise