Skip to content

Enable Non-Blocking support for resources that return futures

License

Notifications You must be signed in to change notification settings

dragonzone/dropwizard-async

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Dropwizard Async Non-Blocking Build Status Maven Central

This bundle adds support for resources methods to return CompletionStage and ListenableFuture types, which allow for fully non-blocking handling of requests.

To use this bundle, add it to your application in the initialize method:

@Override
public void initialize(Bootstrap<T> bootstrap) {
    bootstrap.addBundle(new AsyncBundle());
}

After that, simply return a CompletableFuture from your resource methods and they will no longer tie up jetty request threads while the request continues to process.