147 lines
3.8 KiB
YAML
147 lines
3.8 KiB
YAML
|
name: Lock
|
||
|
class_comment: null
|
||
|
dependencies:
|
||
|
- name: LockContract
|
||
|
type: class
|
||
|
source: Illuminate\Contracts\Cache\Lock
|
||
|
- name: LockTimeoutException
|
||
|
type: class
|
||
|
source: Illuminate\Contracts\Cache\LockTimeoutException
|
||
|
- name: InteractsWithTime
|
||
|
type: class
|
||
|
source: Illuminate\Support\InteractsWithTime
|
||
|
- name: Sleep
|
||
|
type: class
|
||
|
source: Illuminate\Support\Sleep
|
||
|
- name: Str
|
||
|
type: class
|
||
|
source: Illuminate\Support\Str
|
||
|
- name: InteractsWithTime
|
||
|
type: class
|
||
|
source: InteractsWithTime
|
||
|
properties:
|
||
|
- name: name
|
||
|
visibility: protected
|
||
|
comment: '# * The name of the lock.
|
||
|
|
||
|
# *
|
||
|
|
||
|
# * @var string'
|
||
|
- name: seconds
|
||
|
visibility: protected
|
||
|
comment: '# * The number of seconds the lock should be maintained.
|
||
|
|
||
|
# *
|
||
|
|
||
|
# * @var int'
|
||
|
- name: owner
|
||
|
visibility: protected
|
||
|
comment: '# * The scope identifier of this lock.
|
||
|
|
||
|
# *
|
||
|
|
||
|
# * @var string'
|
||
|
- name: sleepMilliseconds
|
||
|
visibility: protected
|
||
|
comment: '# * The number of milliseconds to wait before re-attempting to acquire
|
||
|
a lock while blocking.
|
||
|
|
||
|
# *
|
||
|
|
||
|
# * @var int'
|
||
|
methods:
|
||
|
- name: __construct
|
||
|
visibility: public
|
||
|
parameters:
|
||
|
- name: name
|
||
|
- name: seconds
|
||
|
- name: owner
|
||
|
default: 'null'
|
||
|
comment: "# * The name of the lock.\n# *\n# * @var string\n# */\n# protected $name;\n\
|
||
|
# \n# /**\n# * The number of seconds the lock should be maintained.\n# *\n# *\
|
||
|
\ @var int\n# */\n# protected $seconds;\n# \n# /**\n# * The scope identifier of\
|
||
|
\ this lock.\n# *\n# * @var string\n# */\n# protected $owner;\n# \n# /**\n# *\
|
||
|
\ The number of milliseconds to wait before re-attempting to acquire a lock while\
|
||
|
\ blocking.\n# *\n# * @var int\n# */\n# protected $sleepMilliseconds = 250;\n\
|
||
|
# \n# /**\n# * Create a new lock instance.\n# *\n# * @param string $name\n#\
|
||
|
\ * @param int $seconds\n# * @param string|null $owner\n# * @return void"
|
||
|
- name: get
|
||
|
visibility: public
|
||
|
parameters:
|
||
|
- name: callback
|
||
|
default: 'null'
|
||
|
comment: "# * Attempt to acquire the lock.\n# *\n# * @return bool\n# */\n# abstract\
|
||
|
\ public function acquire();\n# \n# /**\n# * Release the lock.\n# *\n# * @return\
|
||
|
\ bool\n# */\n# abstract public function release();\n# \n# /**\n# * Returns the\
|
||
|
\ owner value written into the driver for this lock.\n# *\n# * @return string\n\
|
||
|
# */\n# abstract protected function getCurrentOwner();\n# \n# /**\n# * Attempt\
|
||
|
\ to acquire the lock.\n# *\n# * @param callable|null $callback\n# * @return\
|
||
|
\ mixed"
|
||
|
- name: block
|
||
|
visibility: public
|
||
|
parameters:
|
||
|
- name: seconds
|
||
|
- name: callback
|
||
|
default: 'null'
|
||
|
comment: '# * Attempt to acquire the lock for the given number of seconds.
|
||
|
|
||
|
# *
|
||
|
|
||
|
# * @param int $seconds
|
||
|
|
||
|
# * @param callable|null $callback
|
||
|
|
||
|
# * @return mixed
|
||
|
|
||
|
# *
|
||
|
|
||
|
# * @throws \Illuminate\Contracts\Cache\LockTimeoutException'
|
||
|
- name: owner
|
||
|
visibility: public
|
||
|
parameters: []
|
||
|
comment: '# * Returns the current owner of the lock.
|
||
|
|
||
|
# *
|
||
|
|
||
|
# * @return string'
|
||
|
- name: isOwnedByCurrentProcess
|
||
|
visibility: public
|
||
|
parameters: []
|
||
|
comment: '# * Determines whether this lock is allowed to release the lock in the
|
||
|
driver.
|
||
|
|
||
|
# *
|
||
|
|
||
|
# * @return bool'
|
||
|
- name: isOwnedBy
|
||
|
visibility: public
|
||
|
parameters:
|
||
|
- name: owner
|
||
|
comment: '# * Determine whether this lock is owned by the given identifier.
|
||
|
|
||
|
# *
|
||
|
|
||
|
# * @param string|null $owner
|
||
|
|
||
|
# * @return bool'
|
||
|
- name: betweenBlockedAttemptsSleepFor
|
||
|
visibility: public
|
||
|
parameters:
|
||
|
- name: milliseconds
|
||
|
comment: '# * Specify the number of milliseconds to sleep in between blocked lock
|
||
|
acquisition attempts.
|
||
|
|
||
|
# *
|
||
|
|
||
|
# * @param int $milliseconds
|
||
|
|
||
|
# * @return $this'
|
||
|
traits:
|
||
|
- Illuminate\Contracts\Cache\LockTimeoutException
|
||
|
- Illuminate\Support\InteractsWithTime
|
||
|
- Illuminate\Support\Sleep
|
||
|
- Illuminate\Support\Str
|
||
|
- InteractsWithTime
|
||
|
interfaces:
|
||
|
- LockContract
|