• Alex Yarmula's avatar
    Reverted commit D3979179 · b59ee680
    Alex Yarmula authored
    Summary:
    When `delayed` is called on the Future, the underlying `futures::sleep` call runs on a timer thread, and the resulting callback is called on the same thread. Therefore, in the following sequence:
    
      f.via(&someExecutor).within(one_ms).then([&]() { /* [1] */ })
    
    The code in [1] is not running in someExecutor. This can cause confusion by users of the library who expect the initial `via` to be sticky.
    
    This change returns to the prior `Executor` after `delayed` is finished.
    
    Reviewed By: yfeldblum
    
    Differential Revision: D3979179
    
    fbshipit-source-id: e1448f5603f0c9440490ae3bf0e670687f4179f3
    b59ee680
Future-inl.h 39.8 KB