Not at all - I don't think I've ever seen XML-RPC used in a Django project or library. It's more common in the Twisted world though, and this project's default implementation uses Twisted.
This seems to really help bridge a gap in django's toolbox. Working with async actions with pretty much anything other than celery processes is pretty painful. That said I'm not sure I'm a huge fan of tying the events directly to the models, I think I'd rather be able to define the events separately and call the event-firing methods via on save / on delete model methods if I wanted to the model to fire events. Seems a lot more flexible to break that apart so I can reuse the events or fire those events from somewhere other the models if needed. I bet there is a way to do this already in the project I just haven't had enough time to piece it together yet.
Custom events are easy to implement, though we focused in model events as we wanted something with minimal effort to push data to the client.
The event class only needs to know what the django->gateway transport is (xmlrpc as for now).
Sounds cool. I have also been thinking about developing a ready-made Django skeleton with an architecture similar to this. Our publishing looks like this: Django -> Redis -> Express.js -> Browser
Redis really just serves as our bridge, the actual pub/sub happens in socket.io in the express app. The coolest part of this is that when a Django model is updated, we serialize it to its API representation, send that through the wire. On the client, the Backbone model is bound to this event and updates in place.
One of telegraphy's milestones is to generalize the event tansport in the server side. Redis, ZMQ and other pub/sub libs can offer more flexibility and performance than xmlrpc.
11 comments
[ 2.8 ms ] story [ 28.6 ms ] threadRedis really just serves as our bridge, the actual pub/sub happens in socket.io in the express app. The coolest part of this is that when a Django model is updated, we serialize it to its API representation, send that through the wire. On the client, the Backbone model is bound to this event and updates in place.
One interesting approach I came across recently was: https://github.com/chrismccord/sync