-
Notifications
You must be signed in to change notification settings - Fork 14
refactoring the PubSub class #21
Comments
Do you have any idea how to make the json encoder/decoder exchangeable? I'm open to have it swappable. |
i've thought of 2 variants:
|
To be honest, I don't like to many settings. Maybe, we could make the pubsub class exchangable at all? This would allow developers to rewrite any part of it, if needed. |
so |
Hey @szelga what do you need See |
i won't be able to swap so i have 3 suggestions to improve the expandability of pubsub stuff:
|
what |
I don't quite see why you can't swap the class, the factory is being queried from settings (line 29ff) # Get factories for connection and tornado webapp.
authenticator_factory = import_by_path(AUTHENTICATOR_FACTORY)
connection_factory = import_by_path(CONNECTION_FACTORY)
webapp_factory = import_by_path(WEBAPP_FACTORY) thus you should be able to swap in your own factory and use your PubSub subclass there. |
besides that @szelga are all methods exposed to the public but usually you only use |
well, i guess, i could just ignore |
@szelga I'm refactoring the pubsub-code right now to move the initialization to a separate factory that can be replaced. Hope this simplifies how you use it. Stay tuned 😃 |
cool, thanks! |
838b4a1 and other commits in this branch. Let me know what you think. Will be merged soon. |
Still WIP though, this is only a draft. Need to cleanup some code first and make the tests run properly. |
a possibility of using Ultra JSON encoder/decoder would be cool. what else apart from https://github.com/moccu/django-omnibus/blob/master/omnibus/pubsub.py#L104 and settings should be changed?
The text was updated successfully, but these errors were encountered: