Skip to content

Instantly share code, notes, and snippets.

@whysoserious
Created December 11, 2013 12:23
Show Gist options
  • Save whysoserious/7909487 to your computer and use it in GitHub Desktop.
Save whysoserious/7909487 to your computer and use it in GitHub Desktop.
object ApiAsyncDispatcher extends RestCommons with RestHelper {
serve {
case "api" :: "async" :: "all" :: Nil Get req => {
User.currentUser match {
case Full(user) => async {
reply => {
AsyncRestListener ! RequestUpdate(RequestId(user, GroupPost, now), reply)
}
}
case _ => async {
reply => {
Thread.sleep(10 seconds)
reply(jsonErrorResponse(400, "Not logged in"))
}
}
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment