arunoda / meteor-streams

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

It does not work inside a method #36

Open rogeriojlle opened 9 years ago

rogeriojlle commented 9 years ago
var messaging = new Meteor.Stream('messaging');
Meteor.methods({
  "adLogin" : function(req){
    if( req.username && req.domain && req.password){
      var retval = adLogin(req.username, req.domain, req.password);
    } else {
      console.log('não recebi os parâmetros que preciso.', req);
      return false;
    }
    if (retval.success == true){
      return retval.result;
    }
    console.log(retval.result);
    messaging.emit('loginProcessFailed', retval.result);
    return false;
  }
});

The method always ends before the actions of "messaging" happen. Why?