55 lines
1.9 KiB
YAML
55 lines
1.9 KiB
YAML
name: LockFactory
|
|
class_comment: "# * Factory provides method to create locks.\n# *\n# * @author J\xE9\
|
|
r\xE9my Deruss\xE9 <jeremy@derusse.com>\n# * @author Hamza Amrouche <hamza.simperfit@gmail.com>"
|
|
dependencies:
|
|
- name: LoggerAwareInterface
|
|
type: class
|
|
source: Psr\Log\LoggerAwareInterface
|
|
- name: LoggerAwareTrait
|
|
type: class
|
|
source: Psr\Log\LoggerAwareTrait
|
|
- name: LoggerAwareTrait
|
|
type: class
|
|
source: LoggerAwareTrait
|
|
properties: []
|
|
methods:
|
|
- name: createLock
|
|
visibility: public
|
|
parameters:
|
|
- name: resource
|
|
- name: ttl
|
|
default: '300.0'
|
|
- name: autoRelease
|
|
default: 'true'
|
|
comment: "# * Factory provides method to create locks.\n# *\n# * @author J\xE9r\xE9\
|
|
my Deruss\xE9 <jeremy@derusse.com>\n# * @author Hamza Amrouche <hamza.simperfit@gmail.com>\n\
|
|
# */\n# class LockFactory implements LoggerAwareInterface\n# {\n# use LoggerAwareTrait;\n\
|
|
# \n# public function __construct(\n# private PersistingStoreInterface $store,\n\
|
|
# ) {\n# }\n# \n# /**\n# * Creates a lock for the given resource.\n# *\n# * @param\
|
|
\ string $resource The resource to lock\n# * @param float|null $ttl \
|
|
\ Maximum expected lock duration in seconds\n# * @param bool $autoRelease\
|
|
\ Whether to automatically release the lock or not when the lock instance is destroyed"
|
|
- name: createLockFromKey
|
|
visibility: public
|
|
parameters:
|
|
- name: key
|
|
- name: ttl
|
|
default: '300.0'
|
|
- name: autoRelease
|
|
default: 'true'
|
|
comment: '# * Creates a lock from the given key.
|
|
|
|
# *
|
|
|
|
# * @param Key $key The key containing the lock''s state
|
|
|
|
# * @param float|null $ttl Maximum expected lock duration in seconds
|
|
|
|
# * @param bool $autoRelease Whether to automatically release the lock or
|
|
not when the lock instance is destroyed'
|
|
traits:
|
|
- Psr\Log\LoggerAwareInterface
|
|
- Psr\Log\LoggerAwareTrait
|
|
- LoggerAwareTrait
|
|
interfaces:
|
|
- LoggerAwareInterface
|