• Misha Shneerson's avatar
    python event loop consumes one task at a time from C++ notification queue · f133aef5
    Misha Shneerson authored
    Summary:
    Currently, when C++ threads communicate with python's event loop, they place
    the items on the queue, notify the event loop, and when even loops starts
    running, they would consume all items from this queue at once.
    The downside of this approach is that we are unable to deprioritize the
    upstream tasks to yield to internal python tasks. However, such ability to yield
    is fundamental to how Thrift approaches load shedding under overload.
    In this diff we change the approach to take only a single item from the queue at a
    time. Notice that if queue is not emptied, the consumer will notify the event loop to
    consume from this queue on the next iteration of the loop.
    
    Reviewed By: zhxchen17
    
    Differential Revision: D26228933
    
    fbshipit-source-id: 827d21df12b65d518109151cb150cd45e513da57
    f133aef5
AsyncioExecutor.h 2.5 KB