Channel

fun <E> Channel(capacity: Int = RENDEZVOUS): Channel<E> (source)

Creates a channel with the specified buffer capacity (or without a buffer by default). See Channel interface documentation for details.

Parameters

capacity - either a positive channel capacity or one of the constants defined in Channel.Factory.

Exceptions

IllegalArgumentException - when capacity < -2