Skip to content
master
Switch branches/tags
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
src
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Build Status Coverage Status Maven Central JavaDoc Twitter Follow

Guice Asynchronous Methods

Execute arbitrary methods asynchronously or periodically by marking them with an annotation. Quickstart sample:

Set up the Injector:

    Injector injector = Guice.createInjector(GuiceAsync.createModule());

Use the Annotations:

public class MyService {

    @Scheduled
    @CronTrigger("0 0 0 * * *")
    public void executePeriodic(SomeService injectedParameter) {
        // ...
    }
    
    @Async
    public void executeAsynchronously(SomeService someService) {
    }
    
    @Async
    public Future<Integer> asynchronousWithResult() {
        return Futures.delegate(1337);
    }
    
    @Async
    public CompletableFuture<Integer> asynchronousWithCompletableResult() {
        return Futures.delegateCompletable(1337);
    }
}

Please have a look at the wiki for detailed setup and usage instructions (spoiler: it's easy!)

About

Allows to execute tagged methods asynchronously or to easily schedule them for recurring execution

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages