Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //Attempts to download JSON based on the given options and then tries to format it into a DataReaper. Gives a Future in the meantime
- def apply(o: Options): Future[Try[DataReaper]] = {
- val out: Promise[Try[DataReaper]] = Promise()
- $.getJSON(urlBuilder(baseJsonUrl, o))
- .done((data: Dynamic) => out.success(apply(data)))
- .fail((e: Exception) => out.failure(e))
- out.future
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement