Advertisement
Guest User

Untitled

a guest
Jul 26th, 2016
28
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Scala 0.40 KB | None | 0 0
  1. //Attempts to download JSON based on the given options and then tries to format it into a DataReaper. Gives a Future in the meantime
  2.   def apply(o: Options): Future[Try[DataReaper]] = {
  3.     val out: Promise[Try[DataReaper]] = Promise()
  4.     $.getJSON(urlBuilder(baseJsonUrl, o))
  5.       .done((data: Dynamic) => out.success(apply(data)))
  6.       .fail((e: Exception) => out.failure(e))
  7.     out.future
  8.   }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement