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

#311: Locking callbacks for acquiring new refresh token #317

Merged
merged 4 commits into from
Jan 8, 2019
Merged

#311: Locking callbacks for acquiring new refresh token #317

merged 4 commits into from
Jan 8, 2019

Conversation

TessBakker
Copy link
Contributor

@TessBakker TessBakker commented Dec 3, 2018

Added two callbacks for locking and releasing the Connection::acquireAccessToken() method.

See #311 for more information.

@jansloot
Copy link

jansloot commented Dec 3, 2018

I’m liking the idea but wouldn’t this give a false sense of locking. As the PHP eco system allows for individual processes to run in their own “process” space.
Perhaps a proper example on how to build a proper locking callback with use of file system and file locks would make it clearer?

Thanks for taking the effort of adding lock support

@TessBakker
Copy link
Contributor Author

@jansloot I changed the method names, hopefully this make some more sense. Why I didn't implement a file locking system, is that I use Drupal and that has it's own lock and unlocking mechanism.

And nice example would help, feel free to provide one :)

@stephangroen
Copy link
Member

Thanks @TessaBakker

@stephangroen stephangroen merged commit db12cae into picqer:master Jan 8, 2019
@DirkMich
Copy link

DirkMich commented Jan 14, 2019

I'm having some trouble implementing this, could someone make an example to show how this would work when you have more then 1 worker running.

@TessBakker
Copy link
Contributor Author

Hi @FlubberBeer,

Here are some PHP examples of locking technics. I didn't test them, but the codes look like something that could work.

https://www.exakat.io/prevent-multiple-php-scripts-at-the-same-time/

You can use the code to implement it with your own callback functions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants