This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@file:Suppress("KDocUnresolvedReference") | |
package com.examples.standardfunctions | |
import androidx.annotation.Nullable | |
import java.util.* | |
import java.util.function.Function | |
// region Person |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class PipelineBuilder<I, O>( | |
actorScope: ActorScope<I>, | |
outputChannel: Channel<O> | |
) : ActorScope<I> by actorScope { | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class PipelineBuilder<I>( | |
actorScope: ActorScope<I> | |
) : ActorScope<I> by actorScope { | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fun <I, O> CoroutineScope.pipeline(init: PipelineBuilder.() -> Unit): Pipeline<I, O> { | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class PipelineBuilder() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fun <I, O> CoroutineScope.pipeline(init: suspend PipelineBuilder<I, O>.() -> Unit): Pipeline<I, O> { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fun <I, O> CoroutineScope.pipeline(): Pipeline<I, O> { | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private lateinit var intToStringPipeline: Pipeline<Int, String> | |
@Before | |
fun setUp() { | |
intToStringPipeline = CoroutineTestingScope.pipeline() { | |
for (number in channel) { | |
send { number.toString() } | |
} | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
interface Pipeline<I, O> : SendChannel<I>, ReceiveChannel<O> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Test | |
fun given_1_when_send_then_string_of_1() { | |
// Arrange | |
val input: Int = 1 | |
val expected: String = "1" | |
lateinit var actual: String | |
// Act | |
CoroutineTestingScope.launch { | |
intToStringPipeline.send(input) |
NewerOlder