ground-db
ground-db copied to clipboard
Ground.methodResume is a little bit confusingly described
I had some hard time understanding how Ground.methodResume works. Here are the issues I've had:
- It starts in the Concept paragraph, which states
Ground.resumeMethodsinstead ofmethodResume(slight detail, but adds on to the confusion) - I don't think the provided example really helps, it didn't help me at all:
// This is how grounddb uses this internally
Ground.methodResume([
'/' + self.name + '/insert',
'/' + self.name + '/remove',
'/' + self.name + '/update'
], self.connection);
What I got out of this and how I'm using it now could be summarised in the following sentence:
When you to have your server-methods automatically run / resumed on the server, after a connection is established you need to tell this to Ground via
Ground.methodResume. For instance:
Ground.methodResume('serverMethod');
Ground.methodResume(['serverMethod2', 'serverMethod3']);
This is also, how I'm using it now, and it seems to work fine. If that's the correct way, maybe the documentation can be adapted to be easier to understand?
Thx
Its just about telling grounddb what methods are resumable/should be resumed on reconnect. I take pr's :)
PR is here, hope to your satisfaction :) - in which case, 23 to go (http://24pullrequests.com/)
I have this method which i need to be call offline
Meteor.call('programs', remoteHost, diseaseId,deviceToken, function(err, data){
if(!err) {
// do something
}
how can i do this the Ground.methodResume method? Thank you.