Skip to content

Python: add XCLAIM command - #1772

Merged
acarbonetto merged 3 commits into
valkey-io:mainfrom
Bit-Quill:python/dev_jamesx_xclaim
Jul 3, 2024
Merged

acarbonetto merged 3 commits into
valkey-io:mainfrom
Bit-Quill:python/dev_jamesx_xclaim

Conversation

@jamesx-improving

Copy link
Copy Markdown
Collaborator

Issue #, if available:
N/A

Description of changes:
Python: add XCLAIM command

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@jamesx-improving
jamesx-improving requested a review from a team as a code owner July 3, 2024 02:00

@acarbonetto acarbonetto left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

looks good. just a couple of nit comments from me

Comment thread python/python/glide/async_commands/core.py Outdated
Comment thread python/python/glide/async_commands/core.py Outdated
Comment thread python/python/glide/async_commands/core.py Outdated
await self._execute_command(RequestType.XClaim, args),
)

async def xclaim_just_id(

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Suggested change
async def xclaim_just_id(
async def xclaim_justid(

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

just because the argument is called justid on Valkey

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

We already have async def xautoclaim_just_id, should rename as well @acarbonetto ?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

I was about to say the same, that this was aligning with xautoclaim_just_id. Please suggest if we want to rename both.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

ahh... not worth it.

Comment thread python/python/glide/async_commands/core.py Outdated
Comment thread python/python/glide/async_commands/stream.py Outdated
Comment thread python/python/glide/async_commands/transaction.py Outdated
Comment thread python/python/glide/async_commands/transaction.py Outdated

return self.append_command(RequestType.XClaim, args)

def xclaim_just_id(

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Suggested change
def xclaim_just_id(
def xclaim_justid(

TIME_REDIS_API = "TIME"
RETRY_COUNT_REDIS_API = "RETRYCOUNT"
FORCE_REDIS_API = "FORCE"
JUST_ID_REDIS_API = "JUSTID"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

nit

Suggested change
JUST_ID_REDIS_API = "JUSTID"
JUSTID_REDIS_API = "JUSTID"

@jamesx-improving jamesx-improving Jul 3, 2024

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Sorry... I missed it before. Again, not worthwhile probably.

@Yury-Fridlyand Yury-Fridlyand added the python 🐍 Python wrapper label Jul 3, 2024
await self._execute_command(RequestType.XClaim, args),
)

async def xclaim_just_id(

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

We already have async def xautoclaim_just_id, should rename as well @acarbonetto ?

idle (Optional[int]): Set the idle time (last time it was delivered) of the message in milliseconds. If idle
is not specified, an idle of 0 is assumed, that is, the time count is reset because the message now has a
new owner trying to process it.
idle_unix_time (Optional[str]): This is the same as idle but instead of a relative amount of milliseconds,

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Suggested change
idle_unix_time (Optional[str]): This is the same as idle but instead of a relative amount of milliseconds,
idle_unix_time (Optional[int]): This is the same as idle but instead of a relative amount of milliseconds,

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Yury, which hardware store did you get your laser eyes from, I need name, address and aisle number, please 🙏

@Yury-Fridlyand Yury-Fridlyand left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

OK for me, regardless of function renamed or not

@acarbonetto
acarbonetto merged commit 81ef46f into valkey-io:main Jul 3, 2024
@acarbonetto
acarbonetto deleted the python/dev_jamesx_xclaim branch July 3, 2024 17:24
cyip10 pushed a commit to Bit-Quill/valkey-glide that referenced this pull request Jul 16, 2024
* Python: add XCLAIM command

* add CHANGELOG

* address comments
Yury-Fridlyand pushed a commit to Bit-Quill/valkey-glide that referenced this pull request Jun 6, 2025
* Python: add XCLAIM command

* add CHANGELOG

* address comments
affonsov pushed a commit that referenced this pull request Aug 21, 2026
* Python: add XCLAIM command

* add CHANGELOG

* address comments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

python 🐍 Python wrapper

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

3 participants