Small formatting
This commit is contained in:
parent
e21c8792e6
commit
8de4b0bb20
@ -38,19 +38,16 @@ class CoroutineSequencersTest: MatrixTest {
|
|||||||
|
|
||||||
val jobs = listOf(
|
val jobs = listOf(
|
||||||
GlobalScope.launch(dispatcher) {
|
GlobalScope.launch(dispatcher) {
|
||||||
sequencer.post { suspendingMethod("#1") }.also {
|
sequencer.post { suspendingMethod("#1") }
|
||||||
results.add(it)
|
.also { results.add(it) }
|
||||||
}
|
|
||||||
},
|
},
|
||||||
GlobalScope.launch(dispatcher) {
|
GlobalScope.launch(dispatcher) {
|
||||||
sequencer.post { suspendingMethod("#2") }.also {
|
sequencer.post { suspendingMethod("#2") }
|
||||||
results.add(it)
|
.also { results.add(it) }
|
||||||
}
|
|
||||||
},
|
},
|
||||||
GlobalScope.launch(dispatcher) {
|
GlobalScope.launch(dispatcher) {
|
||||||
sequencer.post { suspendingMethod("#3") }.also {
|
sequencer.post { suspendingMethod("#3") }
|
||||||
results.add(it)
|
.also { results.add(it) }
|
||||||
}
|
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
runBlocking {
|
runBlocking {
|
||||||
@ -70,19 +67,16 @@ class CoroutineSequencersTest: MatrixTest {
|
|||||||
val results = ArrayList<String>()
|
val results = ArrayList<String>()
|
||||||
val jobs = listOf(
|
val jobs = listOf(
|
||||||
GlobalScope.launch(dispatcher) {
|
GlobalScope.launch(dispatcher) {
|
||||||
sequencer1.post { suspendingMethod("#1") }.also {
|
sequencer1.post { suspendingMethod("#1") }
|
||||||
results.add(it)
|
.also { results.add(it) }
|
||||||
}
|
|
||||||
},
|
},
|
||||||
GlobalScope.launch(dispatcher) {
|
GlobalScope.launch(dispatcher) {
|
||||||
sequencer2.post { suspendingMethod("#2") }.also {
|
sequencer2.post { suspendingMethod("#2") }
|
||||||
results.add(it)
|
.also { results.add(it) }
|
||||||
}
|
|
||||||
},
|
},
|
||||||
GlobalScope.launch(dispatcher) {
|
GlobalScope.launch(dispatcher) {
|
||||||
sequencer3.post { suspendingMethod("#3") }.also {
|
sequencer3.post { suspendingMethod("#3") }
|
||||||
results.add(it)
|
.also { results.add(it) }
|
||||||
}
|
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
runBlocking {
|
runBlocking {
|
||||||
@ -97,20 +91,17 @@ class CoroutineSequencersTest: MatrixTest {
|
|||||||
val results = ArrayList<String>()
|
val results = ArrayList<String>()
|
||||||
val jobs = listOf(
|
val jobs = listOf(
|
||||||
GlobalScope.launch(dispatcher) {
|
GlobalScope.launch(dispatcher) {
|
||||||
sequencer.post { suspendingMethod("#1") }.also {
|
sequencer.post { suspendingMethod("#1") }
|
||||||
results.add(it)
|
.also { results.add(it) }
|
||||||
}
|
|
||||||
},
|
},
|
||||||
GlobalScope.launch(dispatcher) {
|
GlobalScope.launch(dispatcher) {
|
||||||
val result = sequencer.post { suspendingMethod("#2") }.also {
|
sequencer.post { suspendingMethod("#2") }
|
||||||
results.add(it)
|
.also { results.add(it) }
|
||||||
}
|
.also { println("Result: $it") }
|
||||||
println("Result: $result")
|
|
||||||
},
|
},
|
||||||
GlobalScope.launch(dispatcher) {
|
GlobalScope.launch(dispatcher) {
|
||||||
sequencer.post { suspendingMethod("#3") }.also {
|
sequencer.post { suspendingMethod("#3") }
|
||||||
results.add(it)
|
.also { results.add(it) }
|
||||||
}
|
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
// We are canceling the second job
|
// We are canceling the second job
|
||||||
|
Loading…
Reference in New Issue
Block a user