I'm developing a websocket proxy (https://github.com/wilk/Ext.ux.data.proxy.WebSocket), based on Ext.ux.WebSocket (http://wilk.github.com/ExtJS-WebSocket/).
The proxy works well except when is the server to start the update.
Take the following example:
I've a grid and a store attached: this store has a websocket proxy.
At the beginning, the proxy is created but no CRUD operation is done, neither read operations.
At a certain point, the server pushes some data to every listening websockets and the websocket proxy should update his store: here's the problem!
How can the proxy update his store?
The proxy model is based on the following pattern (if I'm not wrong):
the store makes an operation and tells to his proxy to do it, appending a callback function;
the proxy takes the operation and goes ahead;
when the operation is finished, the proxy calls the store callback function (actually, this is the glue between stores and proxys).
Now, I've no one point of communication between store and proxy until the store makes an operation (a read, for example).
So, before this situation, how can the proxy update his store?
I hope that everything is clear