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

RequestSpec.metadata(Consumer<RequestSpec>) not intuitive name #23639

Closed
rwinch opened this issue Sep 13, 2019 · 3 comments
Closed

RequestSpec.metadata(Consumer<RequestSpec>) not intuitive name #23639

rwinch opened this issue Sep 13, 2019 · 3 comments
Labels
status: superseded An issue that has been superseded by another

Comments

@rwinch
Copy link
Member

rwinch commented Sep 13, 2019

The name for RSocketRequester RequestSpec.metadata(Consumer) is not very intuitive since it can modify the entire RequestSpec. I wonder if we should modify the name or change the argument?

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged or decided on label Sep 13, 2019
@rstoyanchev
Copy link
Contributor

rstoyanchev commented Sep 16, 2019

The method returns RequestSpec so then you need to call data(...) to get to ResponseSpec. So in practice you can only use this to add metadata.

Data is not additive, unlike (composite) metadata, and that means it can only be set by one party. To allow setting both it would have to be something that takes over the request definition:

ResponseSpec apply(Function<ResponseSpec, RequestSpec) configurer);

@rstoyanchev rstoyanchev added the status: waiting-for-feedback We need additional information before we can continue label Sep 16, 2019
@rwinch
Copy link
Member Author

rwinch commented Sep 16, 2019

I see that invoking data won't work, but the API is still a bit confusing because I am providing a Consumer<RequestSpec> which allows me to invoke metadata just as easily as I am data.

@spring-projects-issues spring-projects-issues added status: feedback-provided Feedback has been provided and removed status: waiting-for-feedback We need additional information before we can continue labels Sep 16, 2019
@rstoyanchev
Copy link
Contributor

rstoyanchev commented Sep 20, 2019

This has been addressed as part of #23649 and is now:

RequestSpec metadata(Consumer<MetadataSpec<?>> configurer);

@rstoyanchev rstoyanchev added status: superseded An issue that has been superseded by another and removed status: feedback-provided Feedback has been provided status: waiting-for-triage An issue we've not yet triaged or decided on labels Sep 20, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: superseded An issue that has been superseded by another
Projects
None yet
Development

No branches or pull requests

3 participants