Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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: 9 days 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 8 years ago)
- Default Branch: master
- Last Pushed: 2021-11-15T23:28:01.000Z (almost 3 years ago)
- Last Synced: 2024-10-08T13:09:22.018Z (28 days 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
[![Build Status](https://travis-ci.org/skuzzle/guice-async-extension.svg?branch=master)](https://travis-ci.org/skuzzle/guice-async-extension)
[![Coverage Status](https://coveralls.io/repos/skuzzle/guice-async-extension/badge.svg?branch=master&service=github)](https://coveralls.io/github/skuzzle/guice-async-extension?branch=master)
[![Maven Central](https://maven-badges.herokuapp.com/maven-central/de.skuzzle.inject/guice-async-extension/badge.svg)](https://maven-badges.herokuapp.com/maven-central/de.skuzzle.inject/guice-async-extension)
[![JavaDoc](http://javadoc-badge.appspot.com/de.skuzzle.inject/guice-async-extension.svg?label=JavaDoc)](http://javadoc-badge.appspot.com/de.skuzzle.inject/guice-async-extension)
[![Twitter Follow](https://img.shields.io/twitter/follow/skuzzleOSS.svg?style=social)](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!)