Skip to content
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

[10.x] Allow custom mutex names for isolated commands #47814

Conversation

rybakihor
Copy link
Contributor

Title: Allowing custom mutex names for isolated commands

Description:
This pull request introduces a modification to the commandMutexName function in order to support custom mutex names for isolated commands in Laravel's framework. Previously, all commands with the same name were being blocked simultaneously, regardless of their parameters. With this update, isolated commands can define their own identifier using the getIsolatedMutexName method.

Changes Made:

  • Updated the commandMutexName function in the framework directory to include the command's isolated mutex name, if provided.

  • Added a conditional check using method_exists to determine if the getIsolatedMutexName method is available for the command.

  • If the getIsolatedMutexName method exists, the isolated mutex name is appended to the base name of the command's mutex.

  • If the getIsolatedMutexName method is not present, the base name of the command's mutex is returned as before.

This modification enables more granular control over command execution, allowing isolated commands to have unique mutex names even if they share the same command name. This is especially useful when we want to block the simultaneous execution of a command with the same parameters, but not to block the execution of this command with other parameters.

@driesvints driesvints changed the title Allow custom mutex names for isolated commands [10.x] Allow custom mutex names for isolated commands Jul 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants