Skip to content

Commit

Permalink
Add reader/writer default arguments for coroutineContext parameter (#18)
Browse files Browse the repository at this point in the history
  • Loading branch information
Sergey Mashkov committed Nov 12, 2018
1 parent 7575ac6 commit b4d23d4
Showing 1 changed file with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ interface WriterScope : CoroutineScope {
}

fun CoroutineScope.reader(
coroutineContext: CoroutineContext,
coroutineContext: CoroutineContext = EmptyCoroutineContext,
channel: ByteChannel,
block: suspend ReaderScope.() -> Unit
): ReaderJob {
Expand All @@ -43,8 +43,8 @@ fun CoroutineScope.reader(
}

fun CoroutineScope.reader(
coroutineContext: CoroutineContext,
autoFlush: Boolean,
coroutineContext: CoroutineContext = EmptyCoroutineContext,
autoFlush: Boolean = false,
block: suspend ReaderScope.() -> Unit
): ReaderJob {
val channel = ByteChannel(autoFlush)
Expand Down Expand Up @@ -80,7 +80,7 @@ fun reader(
}

fun CoroutineScope.writer(
coroutineContext: CoroutineContext,
coroutineContext: CoroutineContext = EmptyCoroutineContext,
channel: ByteChannel,
block: suspend WriterScope.() -> Unit
): WriterJob {
Expand All @@ -91,7 +91,7 @@ fun CoroutineScope.writer(
}

fun CoroutineScope.writer(
coroutineContext: CoroutineContext,
coroutineContext: CoroutineContext = EmptyCoroutineContext,
autoFlush: Boolean = false,
block: suspend WriterScope.() -> Unit
): WriterJob {
Expand Down

0 comments on commit b4d23d4

Please sign in to comment.