Contents

onStateUpdate(_:)

Set a closure to be called when the connection’s state changes, which may be called multiple times until the connection is cancelled.

Declaration

@discardableResult final func onStateUpdate(_ handler: @escaping @isolated(any) @Sendable (NetworkConnection<ApplicationProtocol>, NetworkChannel<ApplicationProtocol>.State) -> Void) -> Self

Discussion

This closure will inherit the isolation domain of the caller.