Guice async extension

Allows to execute tagged methods asynchronously

License

License

Categories

Categories

GUI User Interface Guice Application Layer Libs Dependency Injection
GroupId

GroupId

de.skuzzle.inject
ArtifactId

ArtifactId

guice-async-extension
Last Version

Last Version

2.0.0
Release Date

Release Date

Type

Type

jar
Description

Description

Guice async extension
Allows to execute tagged methods asynchronously

Download guice-async-extension

How to add to project

<!-- https://jarcasting.com/artifacts/de.skuzzle.inject/guice-async-extension/ -->
<dependency>
    <groupId>de.skuzzle.inject</groupId>
    <artifactId>guice-async-extension</artifactId>
    <version>2.0.0</version>
</dependency>
// https://jarcasting.com/artifacts/de.skuzzle.inject/guice-async-extension/
implementation 'de.skuzzle.inject:guice-async-extension:2.0.0'
// https://jarcasting.com/artifacts/de.skuzzle.inject/guice-async-extension/
implementation ("de.skuzzle.inject:guice-async-extension:2.0.0")
'de.skuzzle.inject:guice-async-extension:jar:2.0.0'
<dependency org="de.skuzzle.inject" name="guice-async-extension" rev="2.0.0">
  <artifact name="guice-async-extension" type="jar" />
</dependency>
@Grapes(
@Grab(group='de.skuzzle.inject', module='guice-async-extension', version='2.0.0')
)
libraryDependencies += "de.skuzzle.inject" % "guice-async-extension" % "2.0.0"
[de.skuzzle.inject/guice-async-extension "2.0.0"]

Dependencies

compile (7)

Group / Artifact Type Version
com.cronutils : cron-utils jar 9.0.2
org.slf4j : slf4j-api jar 1.7.30
aopalliance : aopalliance jar 1.0
com.google.guava : guava jar 28.0-jre
de.skuzzle.inject : guice-scoped-proxy-extension jar 0.1.0
com.google.inject : guice jar 4.2.2
javax.inject : javax.inject jar 1

test (3)

Group / Artifact Type Version
org.slf4j : slf4j-simple jar 1.7.30
junit : junit jar 4.12
org.mockito : mockito-all jar 1.10.19

Project Modules

There are no modules declared in this project.

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!)

Versions

Version
2.0.0
2.0.0-beta
1.2.2
1.2.1
1.2.0
1.1.0
1.0.0
0.3.0
0.2.0
0.1.0