numtel/meteor-mysql

Subscription change/ready callback?

Opened this issue · 0 comments

hrb commented

Hi,
I'm trying to export some data from a mysql database to text files on the server-side (using the numtel:mysql package).
Basically it looks like this:

'exportSomething': function(variable) {
   mySubscription.change(variable);
   .. code for exporting data from subscription ..
}

The problem is, the subscription is lagging behind (calling it in a loop exports the data from the previous change()), since it's not ready() by the time the export code runs.
Is there a way to wrap my "export data" code in a callback, like I would do when calling a server side method?