Channels

  • A channel is a synchronization primitive.

    Example:

    let channel = Channel<Int>()
    
    let coroutine = try Coroutine {
        try channel.send(42, deadline: 1.second.fromNow())
    }
    
    let theAnswer = try channel.receive(deadline: 1.second.fromNow())
    
    See more

    Declaration

    Swift

    public final class Channel<Type>