https://github.com/skuzzle/guice-async-extension
Allows to execute tagged methods asynchronously or to easily schedule them for recurring execution
https://github.com/skuzzle/guice-async-extension
Last synced: 4 months ago
JSON representation
Allows to execute tagged methods asynchronously or to easily schedule them for recurring execution
- Host: GitHub
- URL: https://github.com/skuzzle/guice-async-extension
- Owner: skuzzle
- License: mit
- Created: 2016-04-03T17:44:35.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2021-11-15T23:28:01.000Z (over 3 years ago)
- Last Synced: 2024-10-08T13:09:22.018Z (9 months ago)
- Language: Java
- Homepage:
- Size: 315 KB
- Stars: 11
- Watchers: 4
- Forks: 4
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
[](https://travis-ci.org/skuzzle/guice-async-extension)
[](https://coveralls.io/github/skuzzle/guice-async-extension?branch=master)
[](https://maven-badges.herokuapp.com/maven-central/de.skuzzle.inject/guice-async-extension)
[](http://javadoc-badge.appspot.com/de.skuzzle.inject/guice-async-extension)
[](https://twitter.com/skuzzleOSS)# Guice Asynchronous Methods
Execute arbitrary methods asynchronously or periodically by marking them with an
annotation. Quickstart sample:Set up the `Injector`:
```java
Injector injector = Guice.createInjector(GuiceAsync.createModule());
```Use the Annotations:
```java
public class MyService {@Scheduled
@CronTrigger("0 0 0 * * *")
public void executePeriodic(SomeService injectedParameter) {
// ...
}
@Async
public void executeAsynchronously(SomeService someService) {
}
@Async
public Future asynchronousWithResult() {
return Futures.delegate(1337);
}
@Async
public CompletableFuture asynchronousWithCompletableResult() {
return Futures.delegateCompletable(1337);
}
}
```Please have a look at the [wiki](https://github.com/skuzzle/guice-async-extension/wiki)
for detailed setup and usage instructions (spoiler: it's easy!)