Skip to content

rename decider to exception_decider to make room for response_decider in version 2 #142

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

Merged
merged 1 commit into from
Dec 30, 2018

Conversation

dbu
Copy link
Contributor

@dbu dbu commented Dec 30, 2018

Q A
Bug fix? no
New feature? no
BC breaks? no
Deprecations? yes
Related tickets preparation for #139
Documentation Callbacks are generally not documented at http://docs.php-http.org/en/latest/plugins/retry.html ...
License MIT

What's in this PR?

Rename callback method in retry plugin options.

Why?

Make room for response decider in version 2.

Checklist

  • Updated CHANGELOG.md to describe BC breaks / deprecations | new feature | bugfix
  • not needed

@dbu dbu mentioned this pull request Dec 30, 2018
2 tasks
Copy link
Member

@Nyholm Nyholm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you

@Nyholm
Copy link
Member

Nyholm commented Dec 30, 2018

Feel free to merge and rebase #139 on this.

@dbu dbu merged commit 955d057 into master Dec 30, 2018
@dbu dbu deleted the rename-retry-exception-callback branch December 30, 2018 16:35
mxr576 added a commit to mxr576/apigee-client-php that referenced this pull request Jan 21, 2019
Unfortunatelly, thanks to this implementation it is impossible to
support older versions of this library by using old and new array keys
in the same time because if both exists in generates an error.
php-http/client-common#142
@mxr576
Copy link
Contributor

mxr576 commented Jan 21, 2019

Sorry to say, but the deprecation handling introduced in this PR is an overkill. As I can see it makes it impossible to support >= 1.9.0 and the older versions of this library by passing both the old and the new array keys to the plugin's construction. Why throwing an exception was necessary?
https://github.com/php-http/client-common/blob/1.9.0/src/Plugin/RetryPlugin.php#L55

mxr576 added a commit to mxr576/apigee-client-php that referenced this pull request Jan 21, 2019
Unfortunatelly, thanks to this implementation it is impossible to
support older versions of this library by using old and new array keys
in the same time because if both exists it throws an exception.
php-http/client-common#142
@dbu
Copy link
Contributor Author

dbu commented Jan 27, 2019

the exception is necessary because otherwise we would need to define a priority for redundant (and therefor potentially contradictory) options. and version 2 will no longer accept the old argument, while version 1.8 and older does not know anything about the new parameter.

i think for this, you will need to distinguish versions if you need to support both 1.9 and 2, if your code instantiates this and otherwise explain the configuration to the user.

mxr576 added a commit to mxr576/apigee-client-php that referenced this pull request Feb 6, 2019
Unfortunatelly, thanks to this implementation it is impossible to
support older versions of this library by using old and new array keys
in the same time because if both exists it throws an exception.
php-http/client-common#142
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.

3 participants