-
Notifications
You must be signed in to change notification settings - Fork 351
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
How to setup callback subscriber function to read messages ? #16
Comments
First of all, you need to create a subscriber object:
If you want to subscribe to a channel, i.e. SUBSCRIBE CHANNEL, you can set a callback with the
If you want to subscribe to a pattern, i.e. PSUBSCRIBE PATTERN, you can set a callback with the
After setting the callbacks, you can consume these messages in a loop:
Also check the doc for other examples. If you still have problem with this feature, you can show me your code. I'll try to point out your problem of the code. Regards |
The above examples use Lambda as the callback function. If you're not familiar with lambda, you can also set a free function as the callback:
|
As you guessed i'm not familiar with a Lamba, but your free function as the callback works as intended. I am very grateful for quick response. We can close issue. |
I'm glad that the problem is solved. If you have any other problems with redis-plus-plus in the future, always feel free to let me know. If you like this client, also feel free to star it :) |
I'm struggle with subscribe feature. I don't know exactly how to set up callback function to (for example) print received messages. The connection settings are correct, because i can easily set value to key.
The text was updated successfully, but these errors were encountered: