File tree Expand file tree Collapse file tree 1 file changed +21
-1
lines changed
src/Symfony/Component/Lock/Store Expand file tree Collapse file tree 1 file changed +21
-1
lines changed Original file line number Diff line number Diff line change 1616use Psr \Log \NullLogger ;
1717use Symfony \Component \Lock \BlockingStoreInterface ;
1818use Symfony \Component \Lock \Exception \LockConflictedException ;
19+ use Symfony \Component \Lock \Exception \NotSupportedException ;
1920use Symfony \Component \Lock \Key ;
2021use Symfony \Component \Lock \PersistingStoreInterface ;
22+ use Symfony \Component \Lock \SharedLockStoreInterface ;
2123
2224/**
2325 * RetryTillSaveStore is a PersistingStoreInterface implementation which decorate a non blocking PersistingStoreInterface to provide a
2426 * blocking storage.
2527 *
2628 * @author Jérémy Derussé <jeremy@derusse.com>
2729 */
28- class RetryTillSaveStore implements BlockingStoreInterface, LoggerAwareInterface
30+ class RetryTillSaveStore implements BlockingStoreInterface, SharedLockStoreInterface, LoggerAwareInterface
2931{
3032 use LoggerAwareTrait;
3133
@@ -76,6 +78,24 @@ public function waitAndSave(Key $key)
7678 throw new LockConflictedException ();
7779 }
7880
81+ public function saveRead (Key $ key )
82+ {
83+ if (!$ this ->decorated instanceof SharedLockStoreInterface) {
84+ throw new NotSupportedException (sprintf ('The store "%s" does not decorate compatible store. ' , get_debug_type ($ this )));
85+ }
86+
87+ $ this ->decorated ->saveRead ($ key );
88+ }
89+
90+ public function waitAndSaveRead (Key $ key )
91+ {
92+ if (!$ this ->decorated instanceof SharedLockStoreInterface) {
93+ throw new NotSupportedException (sprintf ('The store "%s" does not decorate compatible store. ' , get_debug_type ($ this )));
94+ }
95+
96+ $ this ->decorated ->waitAndSaveRead ($ key );
97+ }
98+
7999 /**
80100 * {@inheritdoc}
81101 */
You can’t perform that action at this time.
0 commit comments