Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Flight] Implement FlightClient in terms of Thenable/Promises instead of throwing Promises #25260

Merged
merged 8 commits into from
Sep 15, 2022

Commits on Sep 15, 2022

  1. [Flight] Align Chunks with Thenable used with experimental_use

    Use the field names used by the Thenable data structure passed to use().
    These are considered public in this model.
    
    This adds another field since we use a separate field name for "reason".
    sebmarkbage committed Sep 15, 2022
    Configuration menu
    Copy the full SHA
    73e6a44 View commit details
    Browse the repository at this point in the history
  2. Implement Thenable Protocol on Chunks

    This doesn't just ping but resolves/rejects with the value.
    sebmarkbage committed Sep 15, 2022
    Configuration menu
    Copy the full SHA
    23920ea View commit details
    Browse the repository at this point in the history
  3. Subclass Promises

    sebmarkbage committed Sep 15, 2022
    Configuration menu
    Copy the full SHA
    744b7bb View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    fda26be View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    372c008 View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    737b236 View commit details
    Browse the repository at this point in the history
  7. Block a model from initializing if its direct dependencies are pending

    If a module is blocked, then we can't complete initializing a model.
    However, we can still let it parse, and then fill in the missing pieces
    later.
    
    We need to block it from resolving until all dependencies have filled in
    which we can do with a ref count.
    sebmarkbage committed Sep 15, 2022
    Configuration menu
    Copy the full SHA
    b41cf4f View commit details
    Browse the repository at this point in the history
  8. Treat blocked modules or models as a special status

    We currently loop over all chunks at the end to error them if they're
    still pending. We shouldn't do this if they're pending because they're
    blocked on an external resource like a module because the module might not
    resolve before the Flight connection closes and that's not an error.
    
    In an alternative solution I had a set that tracked pending chunks and
    removed one at a time. While the loop at the end is faster it's more
    work as we go.
    
    I figured the extra status might also help debugging.
    
    For modules we can probably assume no forward references, and the first
    async module we can just use the promise as the chunk.
    
    So we could probably get away with this only on models that are blocked by
    modules.
    sebmarkbage committed Sep 15, 2022
    Configuration menu
    Copy the full SHA
    1c481e9 View commit details
    Browse the repository at this point in the history