Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Progressive Response in Java
sendProgressiveResponseMessage("Please wait!", handlerInput);
public static void sendProgressiveResponseMessage(final String message,
final HandlerInput handlerInput){
final SpeakDirective speakDirective = SpeakDirective.builder()
final String requestId = handlerInput.getRequestEnvelope().getRequest().getRequestId();
final SendDirectiveRequest sendDirectiveRequest = SendDirectiveRequest.builder()

This comment has been minimized.

Copy link

kinisoftware commented Jun 28, 2019

This is my code, quite similar but in Kotlin:

private fun enqueueMessage(message: String) {
        val requestId = input.requestEnvelope.request.requestId
        val sendDirectiveRequest = SendDirectiveRequest.builder()
                        .withSpeech("${getRandomOkSpeech()}, $message")

Now the challenge is to make the logic await till the progressive response is done before returning the final response :) Working on it!


This comment has been minimized.

Copy link
Owner Author

germanviscuso commented Jun 28, 2019

Nice!! Yes, it's basically the same. Let me know if you manage to "await" :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.