of

fun <X : Any> of(generator: () -> X?, availabilityChecker: () -> Boolean): InputChannel<X>

Creates an InputChannel producing elements from generator (returning null when exhausted), whose available reflects availabilityChecker.


fun <X : Any> of(generator: () -> X?): InputChannel<X>

Same as the two-argument of, but always reports available as true.


Creates an InputChannel that yields string, one character at a time.