Skip to content

Conversation

sazzad16
Copy link
Contributor

@sazzad16 sazzad16 commented Dec 7, 2020

Resolves #2277

@sazzad16 sazzad16 requested a review from gkorland December 7, 2020 14:10
@sazzad16 sazzad16 added this to the 3.4.0 milestone Dec 7, 2020
Copy link

@dengliming dengliming left a comment

Choose a reason for hiding this comment

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

Personally, I think we can do this logic by simply determining whether the block is greater than 0 or not, and in general I usually think that if a block is equal to 0 or less than 0, you don't need a block, and we can explain that in comment. Using XReadParams is good too. can avoid having too many arguments for this method. and we can also comment or deprecated void xread(int count, long block, Entry<String, StreamEntryID>... streams); since the block param is not working. Thanks. : )

@sazzad16
Copy link
Contributor Author

@dengliming

we can also comment or deprecated void xread(int count, long block, Entry<String, StreamEntryID>... streams); since the block param is not working

Nice suggestion, thanks

@dengliming

This comment was marked as off-topic.

dengliming
dengliming previously approved these changes Mar 15, 2021
Copy link

@dengliming dengliming left a comment

Choose a reason for hiding this comment

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

LGTM

dengliming
dengliming previously approved these changes Mar 15, 2021
dengliming
dengliming previously approved these changes Mar 16, 2021
private static final String BLOCK = "BLOCK";
private static final String NOACK = "NOACK";

public static XReadGroupParams xReadGroupParams() {
Copy link
Contributor

Choose a reason for hiding this comment

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

@sazzad16 I would have consider a different name for xReadGroupParams() perhaps create()

This comment was marked as off-topic.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@gkorland It is there for method chaining. Any good enough name is okay to me.

@dengliming Empty constructor is still an option to the users if they want to use. I don't to hide it until it is hurting the development process.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@gkorland We are carrying this pattern probably since Jedis 2.10.0. Each of the Params classes have a static method with name at this pattern. Some of already merged PR's for 3.6.0 include this pattern. If we want replace this pattern with something like create(), we'll always have time to do that. IMHO, we shouldn't keep this PR on hold just for this matter if we agree on the implementation of this PR.

Copy link
Contributor

Choose a reason for hiding this comment

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

Each of the Params classes have a static method with name at this pattern.

If that is the common pattern then lest leave it like that

@sazzad16 sazzad16 merged commit 43d8121 into redis:master Mar 18, 2021
@sazzad16 sazzad16 deleted the xread-block-2 branch March 18, 2021 06:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

xread with block=0 doesn't block

3 participants