arunoda / meteor-streams

Realtime messaging for Meteor
http://arunoda.github.io/meteor-streams
MIT License
287 stars 97 forks source link

Notifications between server events #4

Closed razvangherghina closed 6 years ago

razvangherghina commented 10 years ago

I think it would be interesting to add the "emit - on" functionality even at server level. Probably there are other packages that are doing that, but it is interesting to chain notifications with the meteor-streams without the need to install other packages.

Example:

eventStream = new Meteor.Stream('eventstream');

if(Meteor.isServer) {
  sendEvent = function(message) {
    eventStream .emit('eventName', message);
       console.log('event just triggered from server: ' + message);
  };

  eventStream .on('eventName', function(message) {
    console.log('subscriber function triggered : ' + message);
  });
}
arunoda commented 10 years ago

Yes. this is something that is on the roadmap, hopefully around next week :)

arunoda commented 10 years ago

The idea is like this, we'll be having a new Stream Class(Meteor.ServerStream) which can talk between servers. It has following features

In order this to be work, this need to be coupled with Meteor Cluster.

I'll post more info when its done. Anyway, you won't need to use any third party tools like redis for this.