thread-synchronization

Code utility to synchronize two or more concurrent thread processes so they don't execute simultaneously critical code sections

Лицензия

Лицензия

Группа

Группа

com.hubbledouble
Идентификатор

Идентификатор

thread-synchronization
Последняя версия

Последняя версия

1.0.0
Дата

Дата

Тип

Тип

jar
Описание

Описание

thread-synchronization
Code utility to synchronize two or more concurrent thread processes so they don't execute simultaneously critical code sections
Ссылка на сайт

Ссылка на сайт

https://github.com/hubbledouble/thread-synchronization
Организация-разработчик

Организация-разработчик

Pivotal Software, Inc.
Система контроля версий

Система контроля версий

http://github.com/hubbledouble/thread-synchronization

Скачать thread-synchronization

Как подключить последнюю версию

<!-- https://jarcasting.com/artifacts/com.hubbledouble/thread-synchronization/ -->
<dependency>
    <groupId>com.hubbledouble</groupId>
    <artifactId>thread-synchronization</artifactId>
    <version>1.0.0</version>
</dependency>
// https://jarcasting.com/artifacts/com.hubbledouble/thread-synchronization/
implementation 'com.hubbledouble:thread-synchronization:1.0.0'
// https://jarcasting.com/artifacts/com.hubbledouble/thread-synchronization/
implementation ("com.hubbledouble:thread-synchronization:1.0.0")
'com.hubbledouble:thread-synchronization:jar:1.0.0'
<dependency org="com.hubbledouble" name="thread-synchronization" rev="1.0.0">
  <artifact name="thread-synchronization" type="jar" />
</dependency>
@Grapes(
@Grab(group='com.hubbledouble', module='thread-synchronization', version='1.0.0')
)
libraryDependencies += "com.hubbledouble" % "thread-synchronization" % "1.0.0"
[com.hubbledouble/thread-synchronization "1.0.0"]

Зависимости

compile (2)

Идентификатор библиотеки Тип Версия
org.springframework.boot : spring-boot-starter-data-mongodb jar 2.3.0.RELEASE
junit : junit jar 4.13

Модули Проекта

Данный проект не имеет модулей.

Thread Synchronization

Ensures two or more concurrent thread processes be synchronized so they don't execute simultaneously critical code sections. Using this library makes it easy to focus on the business process than worrying about performing thread synchronization while executing the same process code in two or more distributed nodes.

For more about thread synchronization, please visit here

Usage example:
Import the following library

<dependency>
	<groupId>com.hubbledouble</groupId>
	<artifactId>thread-synchronization</artifactId>
	<version>1.0.0</version>
</dependency>

 
External requirements:

  • Mongo database (this libreary will write to it for synchronizing the processes)
  • Spring Mongo Data dependency
<dependency>
	<groupId>org.springframework.boot</groupId>
	<artifactId>spring-boot-starter-data-mongodb</artifactId>
</dependency>

 
Sample java code:

import com.hubbledouble.thread.synchronization.ThreadSynchronization;
import com.mongodb.client.MongoClient;
import com.mongodb.client.MongoClients;
import org.springframework.data.mongodb.core.MongoOperations;
import org.springframework.data.mongodb.core.MongoTemplate;

public class Application {

    private static final ThreadSynchronization THREAD_SYNCHRONIZATION = threadSynchronization(mongoTemplate());

    public static MongoTemplate mongoTemplate() {

        MongoClient mongo = MongoClients.create();
        return new MongoTemplate(mongo, "databaseName");

    }

    public static ThreadSynchronization threadSynchronization(MongoOperations mongoOperations) {
        return new ThreadSynchronization(mongoOperations);
    }

    public static void main(String[] args) {

        THREAD_SYNCHRONIZATION.execute("processName", () ->
                System.out.println("Hello synchronized world!")
        );

    }

}

Версии библиотеки

Версия
1.0.0