feathersjs-ecosystem / feathers-sync

Synchronize service events between Feathers application instances
MIT License
222 stars 41 forks source link

Using channels with feathers-sync #132

Closed averri closed 4 years ago

averri commented 4 years ago

Broadcasting the events to all clients is not always desirable. feathers-sync should respect the channel configuration and publish/subscribe to the configured channels instead of broadcasting all the events to all clients.

daffl commented 4 years ago

This module is meant for server side for scaling/load balancing purposes. The channel system for connected clients still works the same even when using feathers-sync (if it doesn't this would be a bug of course).

averri commented 4 years ago

Thanks @daffl, I was able to configure feathers-sync with Redis and SocketIO, it's working fine, but I had to overcome an issue with feathers-sync: if you add a new function property to the 'connection' object in the 'connection' event handler, feathers-sync will remove it. It's probably because some JSON.stringify.

My working demo: https://gitlab.com/averri/feathers-sync