-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[RFC] [Console] [Lock] Locking a command on multiple servers #35535
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Well, use the Lock component directly for that. It is able to do that. But locks shared between servers require a shared storage (a Redis server for instance), so this cannot be implemented in the LockableTrait which hides the details of using the Lock component. |
@stof thx for the fast answer :) yes my request was mainly to put the pdo lock in this trait, inside the symfony core to avoid relying on a devland implementation |
We cannot put the PDO lock in the trait. As soon as you want to use a lock factory injected through dependency injection (to be able to use the pdo store configured by FrameworkBundle), the trait is useless. All the remaining logic is already encapsulated in the lock component itself: https://symfony.com/doc/master/components/lock.html#usage And making the trait itself support injecting a factory inside it would make it more complex. |
@stof ok i see your point now, I will duplicate such trait to my devland code then and leveraging the pdo lock feature instead thank you again for your time (closed) |
Description
Hi,
RFC issue related to https://symfony.com/doc/master/console/lockable_trait.html, and the sentence
the same command in a single server
I want to know if this console lock feature can be extended/improved to have a
multiple server
feature?Using for example pdo lock or redis one.
Thank you,
The text was updated successfully, but these errors were encountered: