Make it easy to wrap pre-existing cob-style async apis
Summary: Tao neesd a way to wrap its c-style async apis with Later. Although my comments suggest that you can do this, it turns out I never got around to implementing it. Well, here is the implementation. Basically, we supply the callback to the pre-existing api, and that callback will fulfill a promise that is used internally within Later. This is thread safe because the async call is not made until the starter is fired, and we can use the future immediately for chaining then() calls. Test Plan: unit test Reviewed By: hannesr@fb.com FB internal diff: D1197721
Showing
Please register or sign in to comment