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

Enforce Sendability in EventLoopFuture and EventLoopPromise methods #2501

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Commits on Aug 11, 2023

  1. Enforce Sendability in EventLoopFuture and EventLoopPromise methods

    # Motivation
    With apple#2496 we fixed a Sendability checking hole by removing the unconditional conformance of `EventLoopFuture/Promise` to `Sendable`. This was the correct thing to do; however, it has the fallout that a couple of methods are now rightly complaining that their values are send across isolation domains.
    
    # Modification
    This PR requires values on some `ELF/P` methods to be `Sendable` when we might potentially transfer the values across isolation domains/ELs. We have to be overly aggressive here because we do not know that some `ELF` method are staying on the same EL. For example `flatMap` gets a new `ELF` from the closure provided to it. If the `ELF` is on the same EL we do not need to hop; however, we can not guarantee this right now from a type level so we have to stay on the safe side and actually require the `NewValue` to be `Sendable`.
    
    # Result
    This PR makes us more correct from a Sendability perspective but produces warnings for some safe patterns that are currently in use.
    FranzBusch committed Aug 11, 2023
    Configuration menu
    Copy the full SHA
    9d9ac1c View commit details
    Browse the repository at this point in the history