Skip to content

Instantly share code, notes, and snippets.

View lnmunhoz's full-sized avatar

Lucas N. Munhoz lnmunhoz

View GitHub Profile
@lnmunhoz
lnmunhoz / meteor-async.md
Created March 10, 2016 22:50 — forked from joscha/meteor-async.md
Meteor Async Guide

From Meteor's documentation:

In Meteor, your server code runs in a single thread per request, not in the asynchronous callback style typical of Node. We find the linear execution model a better fit for the typical server code in a Meteor application.

This guide serves as a mini-tour of tools, trix and patterns that can be used to run async code in Meteor.

Basic async

Sometimes we need to run async code in Meteor.methods. For this we create a Future to block until the async code has finished.