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

api XReadGroup #3194

Open
ajchen-88 opened this issue Nov 24, 2024 · 0 comments
Open

api XReadGroup #3194

ajchen-88 opened this issue Nov 24, 2024 · 0 comments

Comments

@ajchen-88
Copy link

Issue tracker is used for reporting bugs and discussing new features. Please use
stackoverflow for supporting issues.

use XReadGroup read msg from stream:

			entries, err := client.XReadGroup(ctx1, &redis.XReadGroupArgs{
				Group:    group,
				Consumer: consumer,
				Streams:  []string{streamName, ">"},
				//Streams: []string{"mystream"},
				Count: 10,
				Block: 5000, //  Block for 5000 milliseconds
			}).Result()

Expected Behavior

Use XReadGroup to read messages from the specified consumer group, setting the Block parameter to 5000 milliseconds.
If no new messages are available, the program will return after 5 seconds and continue the loop.

Current Behavior

if we set Block: 5000 the api is block and not return ,until the new message come

Possible Solution

Steps to Reproduce

			entries, err := client.XReadGroup(ctx1, &redis.XReadGroupArgs{
				Group:    group,
				Consumer: consumer,
				Streams:  []string{streamName, ">"},
				//Streams: []string{"mystream"},
				Count: 10,
				Block: 5000, //  Block for 5000 milliseconds
			}).Result()

Context (Environment)

Detailed Description

Possible Implementation

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

No branches or pull requests

1 participant