-
Notifications
You must be signed in to change notification settings - Fork 35
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
Custom backend feature #122
Comments
@2tunnels hi! it sounds ok, but your |
Yes, but HTTP server implementation is hardcoded. Let's say I want to use |
I think it will be better to implement class-based backend pattern. I'll think about it. |
Sounds good! But will |
I thing class is better because I want to support multiple backends and one backend will be able to initiate with different settings and it also allow the beckend to use instance variables to use caching, collect stats, keeping connections and so on. |
If you want to separate configuration and execution steps, yes, class approach makes more sense. |
As I understand right now, this package supports only 3 MJML backends: cmd, tcpserver, and httpserver. Also, there is no way to extend this list because all variants are hardcoded.
https://github.com/liminspace/django-mjml/blob/master/mjml/tools.py#L156
I think it would be very nice to have a custom option to pass any path to some callable. This way, anyone can build their backend if needed.
For example:
Now rendering part can be easily delegated anywhere we want.
I can create pull request, but I think I will need some help with testing 😄
The text was updated successfully, but these errors were encountered: