Async annotation wrapper
Summary: ## Why is this diff needed? This diff presents an annotation framework designed to address some of the issues we've had working with fibers in NodeAPI: - It's difficult to identify functions doing I/O. As a result, we've had I/Os happening sequentially in for loops. - It's difficult to tell if a function is running on fibers. This is especially hard in large code bases such as ours ## What does this diff do? The `Async<T>` type can be used as the return type of a function. This accomplishes a couple of things: - It indicates that this function should run on fibers and that a fiber can suspend in this function (or in one of it's children) - It forces calling functions to `await` the result of this function. When coupled with a good lint rule, this enforces annotations right to the top of the stack. Reviewed By: A5he Differential Revision: D21159049 fbshipit-source-id: ee922093b140b22d8e7a7587b87aa0e783055b6c
Showing
folly/fibers/async/Async.cpp
0 → 100644
folly/fibers/async/Async.h
0 → 100644
Please register or sign in to comment