Skip to content

Conversation

monkey92t
Copy link
Collaborator

@monkey92t monkey92t commented Feb 14, 2023

change ListElementCmd to KeyValuesCmd. #2440

Using KeyValuesCmd seems more reasonable.

@monkey92t monkey92t changed the title New cmd struct refactor: change ListElementCmd to KeyValuesCmd. Feb 14, 2023
@vmihailenco
Copy link
Collaborator

I like the new KeyValuesCmd name, but I think the old API was cleaner:

// This is better
key, elems, err := client.LMPop(ctx, "left", 3, "list1", "list2").Result()

// This is worse
keyVals, err := client.LMPop(ctx, "left", 3, "list1", "list2").Result()

Could we keep the old API or I am missing something?

@monkey92t
Copy link
Collaborator Author

I like the new KeyValuesCmd name, but I think the old API was cleaner:

// This is better
key, elems, err := client.LMPop(ctx, "left", 3, "list1", "list2").Result()

// This is worse
keyVals, err := client.LMPop(ctx, "left", 3, "list1", "list2").Result()

Could we keep the old API or I am missing something?

OK, we keep the KeyValuesCmd name, but the API uses:

key, elems, err := client.LMPop()

@vmihailenco
Copy link
Collaborator

OK, we keep the KeyValuesCmd name, but the API uses:

Sounds good. I think we already have APIs like this.

Signed-off-by: monkey92t <[email protected]>
@monkey92t monkey92t merged commit d2c53bd into redis:master Feb 14, 2023
@monkey92t monkey92t deleted the new_cmd_struct branch February 14, 2023 13:56
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.

2 participants