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

Adds support for Redis setGet command #3017

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open

Conversation

marcingrzejszczak
Copy link
Contributor

fixes #2853

Copy link
Member

@mp911de mp911de left a comment

Choose a reason for hiding this comment

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

Some reactive and interface bits are missing. Care to have a look?

@@ -62,15 +63,23 @@ class SetCommand extends KeyCommand {
private @Nullable ByteBuffer value;
private Expiration expiration;
private SetOption option;
private boolean get;
Copy link
Member

Choose a reason for hiding this comment

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

That isn't going to work as the set API returns a boolean response.

* @see <a href="https://redis.io/commands/set">Redis Documentation: SET</a>
* @since 3.4
*/
Flux<ByteBufferResponse<SetCommand>> setGet(ByteBuffer key, ByteBuffer value, Expiration expiration, SetOption option);
Copy link
Member

Choose a reason for hiding this comment

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

Here we need both signatures, Mono<ByteBuffer> setGet(ByteBuffer key, ByteBuffer value, Expiration expiration, SetOption option) { and Flux<ByteBufferResponse<SetCommand>> set(Publisher<SetCommand> commands);

The first one delegates to the latter.

* @see <a href="https://redis.io/commands/set">Redis Documentation: SET</a>
* @since 3.4
*/
V setGet(K key, V value, long timeout, TimeUnit unit);
Copy link
Member

Choose a reason for hiding this comment

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

You might want to update BoundValueOperations (the interface) and ReactiveValueOperations as well.

@marcingrzejszczak
Copy link
Contributor Author

Changes applied

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: enhancement A general enhancement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add StringCommand for a SET with GET option
2 participants