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

Filter out finished statuses in the BaseConsumer #116

Closed
willgraf opened this issue Jun 29, 2020 · 1 comment
Closed

Filter out finished statuses in the BaseConsumer #116

willgraf opened this issue Jun 29, 2020 · 1 comment
Labels
enhancement New feature or request

Comments

@willgraf
Copy link
Contributor

In ImageFileConsumer._consume we check that the hash's status is not a finished status. This seems pretty useful, and should probably be moved into the BaseConsumer class, perhaps in get_redis_hash. That way, future custom consumers can do not need to implement it themselves.

Originally posted by @willgraf in #115

@willgraf willgraf added the enhancement New feature or request label Jul 2, 2020
@willgraf
Copy link
Contributor Author

willgraf commented Jul 6, 2020

After more consideration, I'm not sure how useful this would be.

Yes, the BaseConsumer can check the status of the hash before we pass it to _consume. But we will still have a _consume function defined that takes in a Redish hash and only needs to do work if the hash's status is valid. It seems like that logic should be incorporated into _consume, and not into whatever function calls _consume.

Even if we baked the log into the parent class, new consumers would be required to call super, which is a bit less clear about what's going on.

@willgraf willgraf closed this as completed Jul 6, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant