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

Finish implementation of pubsub #120

Closed
wants to merge 1 commit into from
Closed

Finish implementation of pubsub #120

wants to merge 1 commit into from

Conversation

alertedsnake
Copy link

The original pubsub implementation didn't actually work
fully, it's supposed to be a callable.

So I've implemented much more of it, enough to mock reasonably.
You do basic things like publish messages, but most everything else
is just a no-op. Most of what pubsub does doesn't really work well
when mocking anyway, so this is good enough to deal with the basics.

Feel free to suggest more functionality - I only need the basics,
but I'd be happy to do a bit more on this if needed.

Fixes #115

The original pubsub implementation didn't actually work
fully, it's supposed to be a callable.

So I've implemented much more of it, enough to mock reasonably.
You do basic things like publish messages, but most everything else
is just a no-op.  Most of what pubsub does doesn't really work well
when mocking anyway, so this is good enough to deal with the basics.

Feel free to suggest more functionality - I only need the basics,
but I'd be happy to do a bit more on this if needed.

Fixes #115
@gpip
Copy link

gpip commented Mar 30, 2017

Hi, thanks for working on this. One feature of redis' publish is that it returns an integer representing the number of clients that received the message, do you see some way to integrate that into this?

@alertedsnake
Copy link
Author

Hmm, it might be reasonable to return just '1' when testing since there's really no way to know the number of clients subscribed, but otherwise I'm not sure what you'd expect here. I can see wanting the feature in the real publish method, but not why I'd be overly concerned about testing it.

@gpip
Copy link

gpip commented Mar 30, 2017

There could be code that uses this return value from publish to do something different based on it. I think it would require implementing the subscribe piece on mockredis so I think it's out of scope for this PR.

@alertedsnake
Copy link
Author

Ah yes, that's a good point, you'd need the subscribe feature first.

@alertedsnake
Copy link
Author

Closing since this repo is no longer used.

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.

Implementation of pubsub seems incorrect
2 participants