Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

after.insert is async? #226

Closed
stefanocudini opened this issue Aug 18, 2017 · 3 comments
Closed

after.insert is async? #226

stefanocudini opened this issue Aug 18, 2017 · 3 comments

Comments

@stefanocudini
Copy link

stefanocudini commented Aug 18, 2017

hi

This is really amazing and useful meteor pkg congrats @matb33 !

I'm using it to perform caching operations for subfields of documents I was wondering if
if any Collection.update(...); inside the after.insert callback is an asynchronous operation or Or I have to do this to get this:

Collection.after.insert(function(id){
  Meteor.defer(function(){
   Collection.update(id, {$set: ... });
  })
});
@micahalcorn
Copy link

micahalcorn commented Sep 2, 2017

In my experience, the callbacks are synchronous and will block.

@zimme
Copy link
Member

zimme commented Sep 3, 2017

Yes, they are sync for now. There is currently a discussion in #229 about this also. Thinking about adding support for returning a promise from a hook and wait for that before continuing on to the actual method.

@stefanocudini
Copy link
Author

ok tnk!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants