We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
now. i use Thread.sleep to make sure all data is processed. bug its not smark. how should i do?
my code:
package org.apache.spark.sql.catalyst.json.com import zio.ZIO import monix.eval._ import monix.execution.Callback import monix.execution.Scheduler import scala.concurrent.duration.DurationInt import monix.reactive._ import monix.execution.Scheduler.Implicits.global import java.lang.Thread.sleep import scala.util.Random object ScalaZIOLearn1 { def main(args: Array[String]): Unit = { val t: Observable[Task[Int]] = { Observable .fromIterable[Int](11 to 2200000 toIterable) .asyncBoundary(OverflowStrategy.BackPressure(3)) // .interval(1.second) // common filtering and mapping .map { x => println(s"map1 ${x}") sleep(Random.nextInt(3000)) x + 10000 } .asyncBoundary(OverflowStrategy.BackPressure(3)) .map { x => println(s"map2 ${x}") sleep(Random.nextInt(3000)) x * 10 } .map { x => Task { // println(s"flatmap: ${x}") println(s"map3 ${x} start") sleep(15000) println(s"map3 ${x} end") x } } } t.subscribe() sleep(Long.MaxValue) // ????????? } }
The text was updated successfully, but these errors were encountered:
No branches or pull requests
now. i use Thread.sleep to make sure all data is processed. bug its not smark. how should i do?
my code:
The text was updated successfully, but these errors were encountered: