Skip to content

Add rpush and rpop commands#39

Open
notak wants to merge 3 commits into
50onRed:masterfrom
notak:clean-version
Open

Add rpush and rpop commands#39
notak wants to merge 3 commits into
50onRed:masterfrom
notak:clean-version

Conversation

@notak

@notak notak commented May 3, 2016

Copy link
Copy Markdown

No description provided.

@notak

notak commented May 3, 2016

Copy link
Copy Markdown
Author

Didn't notice the PR from last year to do the same thing. I think from testing that this one implements the correct ordering on pushing multiple elements.

@PC-AKumar

Copy link
Copy Markdown

I believe this won't work as expected.
The current lpush adds to the end of the list and lpop removes from the end of the list.
To make the rpush and rpop work
a) modifications will have to be made to the lpush and lpop methods to add to the start of the list and remove from the start of the list.
b) rpush should add to the end of the list and remove should get an index of list.size() - 1

@notak

notak commented Aug 4, 2016

Copy link
Copy Markdown
Author

It would be sensible to do that if you wanted to implement lrange. As it is this works just fine for lpush/lpop/rpush/rpop and I was just aiming for a minimal change set. The project seems to be dead anyway

@PC-AKumar

Copy link
Copy Markdown

lrange is already implemented in the library, its just not mentioned in the documentation. And yeah, this project is dead, I wonder why... I am sure people still need to mock jedis for their testing.

@xuanyue202

Copy link
Copy Markdown

I forked a repo and maintain it on the maven central for the rpush/rpop features. Please see https://github.com/xuanyue202/mock-jedis

@cdx-nebiyu

Copy link
Copy Markdown

Thanks @xuanyue202 for resurrecting the project. Curious if you plan on actively maintaining your fork going forward?

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.

4 participants