Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6636091
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T23:08:29+00:00 2026-05-25T23:08:29+00:00

Can you give me some links with good examples how to use continuations in

  • 0

Can you give me some links with good examples how to use continuations in play framework?(beside source of play framework, their ‘samples-and-tests’ and on-site doc, already were there)

Any documentation and theory in “for dummies” format are also appreciated.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T23:08:29+00:00Added an answer on May 25, 2026 at 11:08 pm

    Continuations works mainly by using the await() method that is made available through your Controller. The await method can accept two different types of parameter (there are actually 6 overloads of the method, but they are simple variations on the 2 themes).

    The first is calling await with a timeout. This can be in milliseconds, or can be specified using a String literal expressing the time, e.g. 1s for 1 second etc.

    The second is calling await with a Future object, and most commonly using Play’s implementation of the java Future called Promise (in the libs.F). A Promise returns when the promise is fulfilled, in that the event that is invoked as part of the Promise is completed. However, a Promise can be more than a single event, it can be multiple events. There are even options to say waitAny, so that that it only waits for one of many events to return.

    So, both approaches basically result in an event happening at some point in the future. The first is predetermined, the second depends on how long it takes for the Promise to be fulfilled.

    Play continuations is a way to make the coding of this event structure easier. You can enter some code that says

    // do some logic
    await(timeout or promise);
    // continue the execution
    

    Behind the scenes, the HTTP thread is released, so that Play can process more concurrent requests more efficiently. And when the timeout or promise is fulfilled, the method continues to execute, without you having to code any specific handling for the thread of execution starting up again.

    Taking the code from the Play site for continuations, it says

    public static void loopWithoutBlocking() {
        for(int i=0; i<=10; i++) { 
             Logger.info(i);
             await("1s");
        }
        renderText("Loop finished");
    }
    

    This actually ends the thread of execution 10 times, and start a new thread after a 1 second wait. This whole thing is completely transparent from a programmers perspective, and allows you to build applications intuitively without worrying about creating non-blocking applications, as this is all magically handled by Play!

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

can anyone give me some tips or hook me up with some good links
Can you give me some links or example programs to create UIButtons on a
Can some give me good jQuery lightbox plugin which has zoomin and zoomout function
I'm hoping you can give me some pointers... For some reason when I try
Maybe its a very dumb question but I hope you can give me some
I'm having trouble groking something in Linq - maybe someone can give me some
What is the difference between <tiles:useAttribute ...> and <tiles:insertAttribute ...> Can you give some
Can someone give me some advice on this? I am reading in an old
Can someone give me some info/background info on how I might go about writing
Can anyone give me some idea about uploading data from excel to access database

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.