-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathlock_component.yaml
62 lines (62 loc) · 3.19 KB
/
lock_component.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
questions:
-
uuid: 1eebf878-8ba8-6d34-90fe-99d84c92580c
question: "What's the Component's name that provide exclusive access to a shared resource ?"
answers:
- { value: 'Lockage Component', correct: false }
- { value: 'Lock Component', correct: true }
- { value: 'Lockable Component', correct: false }
help: 'https://symfony.com/doc/current/components/lock.html#installation'
-
uuid: 1eebf878-8ba8-6d7a-a809-99d84c92580c
question: 'What is the best solution to create expiring locks, which are released automatically after some amount of time has passed ?'
answers:
- { value: "$factory->createLock('pdf-creation', expires: 30);", correct: false }
- { value: "$factory->createLock('pdf-creation', ttl: 30);", correct: true }
- { value: "$factory->createLock('pdf-creation', limit: 30);", correct: false }
help: 'https://symfony.com/doc/current/components/lock.html#expiring-locks'
-
uuid: 1eeccba5-7669-608a-9e2a-070a767f65f9
question: 'What function are available in the Lock Component ?'
answers:
- { value: lock(), correct: false }
- { value: release(), correct: true }
- { value: acquire(), correct: true }
- { value: isLocked(), correct: false }
- { value: refresh(), correct: true }
- { value: isAcquired(), correct: true }
- { value: isExpired(), correct: true }
- { value: getRemainingLifetime(), correct: true }
- { value: getTtl(), correct: false }
help: 'https://github.com/symfony/symfony/blob/7.0/src/Symfony/Component/Lock/LockInterface.php'
-
uuid: 1eeccba8-d4e9-6e7c-94fd-51d69966c85d
question: 'What is returned if a user attempts to acquire a lock, but it is unavailable?'
answers:
- { value: LockException, correct: false }
- { value: 'false', correct: true }
- { value: LockedException, correct: false }
help: 'https://symfony.com/doc/current/components/lock.html'
-
uuid: 1eeccbb3-8aa6-6738-a1fb-09a923eb5036
question: 'If we wish to transmit the key to another task such as in a messenger, how can we ensure that the key will not be released ?'
answers:
- { value: "set $lock->noRelease() and then transmit $lock to the messenger. It will have to set $lock->release of it's task", correct: false }
- { value: 'set autoRelease to false in the lock definition', correct: true }
help: 'https://symfony.com/doc/current/components/lock.html#serializing-locks'
-
uuid: 1eeccbc5-3f5d-65da-89c4-b730cc1aa673
question: "What's the way to acquire a lock for only read uses ?"
answers:
- { value: '$lock->acquire($key, true);', correct: false }
- { value: $lock->acquireRead($key);, correct: true }
- { value: $lock->readOnly($key);, correct: false }
help: 'https://symfony.com/doc/current/components/lock.html#shared-locks'
-
uuid: 1eeccbdd-eefd-625c-9ee6-0b7da0b2e285
question: 'Is it possible to promote or demote a lock on its write permission, versus read only.'
answers:
- { value: 'Yes', correct: true }
- { value: 'No', correct: false }
- { value: 'Depends on the store', correct: false }
help: 'https://symfony.com/doc/current/components/lock.html#shared-locks'