Skip to content

Instantly share code, notes, and snippets.

@xicmiah
Created May 16, 2016 10:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save xicmiah/bfcf9dac0c74db8904018b37a5e3b96a to your computer and use it in GitHub Desktop.
Save xicmiah/bfcf9dac0c74db8904018b37a5e3b96a to your computer and use it in GitHub Desktop.
Leak example for Observable#firstL
import monix.execution.Scheduler
import monix.reactive.Observable
object LeakSample {
def main(args: Array[String]) {
implicit val scheduler = Scheduler.computation(2)
val hotObservable = (1 +: Observable.never).behavior(0)
hotObservable.connect()
val task = hotObservable.firstL
while (true) task.runAsync(_ => {})
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment