Skip to content
New issue

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

Akka futures are incredibly ugly #16

Closed
dbarowy opened this issue Nov 20, 2014 · 1 comment
Closed

Akka futures are incredibly ugly #16

dbarowy opened this issue Nov 20, 2014 · 1 comment

Comments

@dbarowy
Copy link
Collaborator

dbarowy commented Nov 20, 2014

and they pollute our DSL. E.g., a function like:

def which_one(text: String) = a.RadioButtonQuestion { q =>
      q.budget = 8.00
      q.text = text
      q.options = List(
        a.Option('oscar, "Oscar the Grouch"),
        a.Option('kermit, "Kermit the Frog"),
        a.Option('spongebob, "Spongebob Squarepants"),
        a.Option('cookie, "Cookie Monster"),
        a.Option('count, "The Count")
      )
    }

used to be callable like:

val future_answer = which_one("Which one of these does not belong?")
val answer = future_answer.value

but now must be called like:

val future_answer = which_one("Which one of these does not belong?")
val answer = Await.result(future_answer, Duration.Inf).value

in addition to a number of new imports.

I think this should be:

val answer = automan { which_one("Which one of these does not belong?") }

where automan is a monadic version of the using-like construct defined in #15. For now, I'd settle for the original behavior.

@dbarowy
Copy link
Collaborator Author

dbarowy commented Apr 28, 2015

Done, as of 0be4932.

@dbarowy dbarowy closed this as completed Apr 28, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant