Skip to content

Instantly share code, notes, and snippets.

@danslapman
Created October 25, 2017 18:49
Show Gist options
  • Save danslapman/09107733876546a34d42dd5df0e7e893 to your computer and use it in GitHub Desktop.
Save danslapman/09107733876546a34d42dd5df0e7e893 to your computer and use it in GitHub Desktop.
Lazy future
type LazyFuture[T] = ReaderT[Future, ExecutionContext, T]
object LazyFuture {
def apply[T](value: => T): LazyFuture[T] = ReaderT.apply { implicit ExecutionContext =>
Future(value)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment