inaes-tic/mbc-common — pull request #48 by pardo-bsso (2014-01-20 17:30:04+00:00)
Title: bindBackend() and sync on server. Redis transport. V2.

This is #46 after all the reviews.

mbc-serverio: bindBackend() on the server and sync with Redis.
==============================================================

This lets you use models from the server and keeping them in sync
with other servers and web browsers without changes.

Just call .pathcBackbone() on your iobackends instance before importing
your models. It will take care of the rest.

On the browser your models will use the bindBackend provided by backbone.io.
On the server they use our version that not only syncs to the backends but
also with the browser and other node processes via redis.

Syncing via redis is optional and can be enabled with something like this
on your backend definition:

```javascript
list: {
use: [middleware.uuid],
redis: {
chain: false,
},
mongo: {
db: db,
collection: collections.Lists,
opts: { search: search_options.Lists },
}},
```

* redis: if true we broadcast our changes to other servers and also when
we get an update it is passed to the browser and our models.
Default value: false.

* chain: if true the processing does not stop at the redis middleware and
goes on to the rest of the chain. This is only needed when using
something like memoryStore() because doing a 'read' in that case
will not return the most recent data. When using mongo (or another
permanent storage) the other end already saved there and so if we
do a 'read' we will get the correct result.
Default value: false.