Can you run a meteor method while another is running?

I have two buttons that fire off meteor methods.

{{#if isRunning}}
  {{>CylonButton method="Stop" text="Stop"}}
{{else}}
  {{>CylonButton method="Start" text="Start"}}
{{/if}}

These call a meteor method on the back end.

Meteor.methods({
  start: function () {
    Cylon.execute('wait', 10000);  // just as an example, waits for 10 seconds
  },
  stop: function () {
    Cylon.execute('stop');  // stops the current execution
    console.log('Stopped');
  }
});

It seems like you can’t press the stop button to fire off the stop method. Is there a way to fix this?

You need to use this.unblock() in the method(s): http://docs.meteor.com/#/full/method_unblock

Wouldn’t I have to unblock in my original start method? What if I didn’t want to do that?

Yes.

I don’t know - why wouldn’t you?

Because I want only that one stop method to be available, but all the other ones to still be blocked

Ah, okay, I understand. That’s an interesting (and useful) requirement. Unfortunately, I don’t know of an easy way to address it - sorry. :disappointed:

I think it can be handled more traditionally via WebApp.connectHandlers but that seems a little clunky