-
Notifications
You must be signed in to change notification settings - Fork 59
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
Add MultiLockHandler and MultiSemaphore helpers #13
Conversation
.gitignore
Outdated
/build/ | ||
/consul-configuration/data-dir/ | ||
/vendor/ | ||
/.idea |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This one should be removed. This should be in your personal global ignore list instead.
I have fixed all issues from comments |
Consul/Helper/MultiLockHandler.php
Outdated
$result = true; | ||
|
||
// Start a session | ||
$session = $this->session->create('{"LockDelay":0, "TTL": "'.$this->ttl.'s"}')->json(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
May be it's better to use json_encode
here. For example, ttl
value is never controlled...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
json_encode will not protect us from wrong ttl value
So i have added validation for ttl in constructor
Do you think it is fine?
Good work ! |
I have made changes for all issues from comments |
@kufd Do you still need this PR? (sorry for the HUGE delay :) ) |
@lyrixx I do not need it |
Can you
Thanks |
@lyrixx would you like to merge this request? However, if you would like to merge the pull request I will prepare it. |
I'm OK to merge it 👍🏼 |
I will prepare this PR i a few days |
@lyrixx, i updated the pull request |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you add an entry in the CHANGELOG.md, and a bit of documentation in the README.md
Thanks
@lyrixx I added some documentation and made fixes |
Here we go 🎉 ! Thanks for your patience and for the hard work. |
Finally))) |
I have added 2 helpers MultiLockHandler and MultiSemaphore which i use in my projects.
So i think it will be usefull for other developers