-
Notifications
You must be signed in to change notification settings - Fork 987
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
Provide VoidOutput for Fire&Forget command usage #1529
Comments
It's possible that StatusOutput should be used instead of |
Care to elaborate where you'd want to use |
I don't have any specific examples. Basically I'm just writing some code that needs to throw various arbitrary module commands at Redis to load data and then get a confirmation that the command is done. I don't care about the output at all -- I just need to know that the command finished. I saw It sounds like
|
That works for RESP2 and only when using byte outputs. Numeric values will fail with |
@mp911de Thanks for the help on this and for adding it to the next milestone! Would the new class for this purpose be pretty much identical to the other VoidOutput class? package io.lettuce.core.output;
// . . .
public class VoidOutput<K, V> extends CommandOutput<K, V, Void> {
public VoidOutput(RedisCodec<K, V> codec) {
super(codec, null);
}
@Override
public void set(ByteBuffer bytes) {
// no-op
}
@Override
public void set(long integer) {
// no-op
}
@Override
public void set(double number) {
// no-op
}
@Override
public void set(boolean value) {
// no-op
}
} I'm not familiar with these output classes (as I'm sure you're well aware) and I had no idea what Redis Serialization Protocol was before you mentioned it so please forgive my ignorance 😄 |
All good, no worries. So basically, we would move |
A couple of clarification points:
Yup, makes total sense and lines up with my previous sample code suggestion
The problem is that An alternative solution might entail creating a . . . Let me know your thoughts on this. For what it's worth, just using the sample code I posted with the String codec appears to be working fine for my use case. But it would be better to avoid passing in a useless codec. |
You're right, I would also advise to not expose a constructor (that is making the constructor of |
The problem is that other classes still rely on that constructor so you can't make the constructor private without further consequences. That's mainly the I think I'm out of my depth here because of my unfamiliarity with the system. You definitely have a good idea in your head about how to go about this so I'll defer to you for implementation. Wish I understood more though so that I could alleviate that burden 😞 |
Thanks for the discussion, it was helpful to understand the use-case for |
We now provide a VoidOutput that can be used for Fire&Forget use of Redis Commands.
We now provide a VoidOutput that can be used for Fire&Forget use of Redis Commands.
Done. |
Bug Report
Current Behavior
The documentation lists several different response types that can be leveraged for the dynamic command feature and
VoidOutput
is one of them. However,VoidOutput
cannot be used because it's package private toio.lettuce.core.dynamic.output
. All of the other outputs are public and live inio.lettuce.core.output
.Input Code
Input Code
Expected behavior/code
New instances of
VoidOutput
may be created.Environment
Possible Solution
Move
VoidOutput
toio.lettuce.core.output
and declare it as public.Additional context
None
The text was updated successfully, but these errors were encountered: