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

Extend XPENDING and add support for XGROUP {CREATECONSUMER,DESTROY,DELCONSUMER}, XINFO {CONSUMERS,GROUPS}, XCLAIM #281

Conversation

sandyharvie
Copy link

@sandyharvie sandyharvie commented Aug 1, 2022

As stated in the title, this PR adds support for the following commands:

  • XGROUP {CREATECONSUMER,DESTROY,DELCONSUMER}
  • XINFO {CONSUMERS,GROUPS}
  • XCLAIM

In addition, I've added support for IDLE to the XPENDING implementation.

@sandyharvie sandyharvie changed the title Add support for XGROUP {DESTROY,DELCONSUMER}, XINFO {CONSUMERS,GROUPS}, and XCLAIM Add support for XGROUP {CREATECONSUMER,DESTROY,DELCONSUMER}, XINFO {CONSUMERS,GROUPS}, and XCLAIM Aug 1, 2022
}
}

// XGROUP CREATE
func (m *Miniredis) cmdXgroupCreate(c *server.Peer, cmd string, args []string) {
stream, group, id := args[1], args[2], args[3]
if len(args) != 3 && len(args) != 4 {
c.WriteError(errWrongNumber("CREATE"))
Copy link
Owner

Choose a reason for hiding this comment

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

All errors also need a setDirty(c) (for transactions).

Copy link
Author

Choose a reason for hiding this comment

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

Got it–fixed!

@alicebob
Copy link
Owner

alicebob commented Aug 2, 2022

Hi! Thanks for the PR. It looks good on first glance, but I'll need some time to have a proper look.

@sandyharvie sandyharvie changed the title Add support for XGROUP {CREATECONSUMER,DESTROY,DELCONSUMER}, XINFO {CONSUMERS,GROUPS}, and XCLAIM Extend XPENDING and add support for XGROUP {CREATECONSUMER,DESTROY,DELCONSUMER}, XINFO {CONSUMERS,GROUPS}, XCLAIM Aug 2, 2022
@alicebob
Copy link
Owner

alicebob commented Aug 9, 2022

PR looks good. I'm still trying to fix the problem with pre 1.17 Go, but I might also say the minimum version of miniredis will be 1.17 (which seems reasonable to me since it's the last version pre-generics).

@sandyharvie
Copy link
Author

PR looks good. I'm still trying to fix the problem with pre 1.17 Go, but I might also say the minimum version of miniredis will be 1.17 (which seems reasonable to me since it's the last version pre-generics).

I think I've fixed the remaining issues in 65aebb7, but feel free to revert the changes if you choose to make 1.17 the minimum supported version.

@alicebob
Copy link
Owner

alicebob commented Aug 9, 2022

Now CI is happy, thanks. Can you squash all the commits? I'll have a final look then (it's a big pr :)

@sandyharvie sandyharvie force-pushed the add-support-for-additional-stream-commands branch from 65aebb7 to e3776cb Compare August 9, 2022 16:07
…,DELCONSUMER}`, `XINFO {CONSUMERS,GROUPS}`, `XCLAIM`
@sandyharvie sandyharvie force-pushed the add-support-for-additional-stream-commands branch from e3776cb to 41c1bec Compare August 9, 2022 16:13
@alicebob alicebob merged commit 82d7bcc into alicebob:master Aug 10, 2022
@alicebob
Copy link
Owner

thanks!

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

Successfully merging this pull request may close these issues.

None yet

2 participants