asynchronizer

Форк
0

README.md

Asynchronizer

Asynchronizer

javadoc

Java Concurrent API does not have enough to develop asynchronous code and work with it comfortably. Every time we have to invent something, otherwise the business logic can be obscured by all the technical details needed to support asynchronicity. The library provides a set of tools that aim to simplify development of asynchronous components, make their code easy-to-read and expressive, and clean the logic from technical details as much as possible.

For example, an implementation of the git pull command might look like this:

CompletableFuture<Void> pull(String repository) {
var localRepository = new LocalRepository(repository);
var remoteRepository = new RemoteRepository(repository);
return AsyncPipeline
// Getting the latest commit of the local repository
.supply(flow -> localRepository.getLastCommit())
// Loading a set of new commits from the remote repository
.await((flow, lastCommit) -> remoteRepository.loadCommitsSince(lastCommit))
// Saving the new commits to the local repository
.await((flow, remoteCommits) -> localRepository.saveCommits(remoteCommits))
.toCompletableFuture();
}

Installation

Gradle

implementation 'ru.asynchronizer:asynchronizer:1.0.0'

Gradle (Kotlin)

implementation("ru.asynchronizer:asynchronizer:1.0.0")

Maven

<dependency>
<groupId>ru.asynchronizer</groupId>
<artifactId>asynchronizer</artifactId>
<version>1.0.0</version>
</dependency>

Documentation

Использование cookies

Мы используем файлы cookie в соответствии с Политикой конфиденциальности и Политикой использования cookies.

Нажимая кнопку «Принимаю», Вы даете АО «СберТех» согласие на обработку Ваших персональных данных в целях совершенствования нашего веб-сайта и Сервиса GitVerse, а также повышения удобства их использования.

Запретить использование cookies Вы можете самостоятельно в настройках Вашего браузера.