Created
December 11, 2013 12:23
-
-
Save whysoserious/7909487 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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