ghedeon
01/17/2019, 2:34 PMclass Foo{
fun CoroutineScope.bar(): ReceiveChannel = produce {}
}
usage:
with (foo) {
bar.consumeEach{}
}
2.
class Foo{
fun bar(scope: CoroutineScope): ReceiveChannel = scope.produce {}
}
usage:
foo.bar(scope).consumeEach{}