A library that implements the event system.
To install it, you will need:
- Java 11+
- Maven/Gradle
- Universal event descriptor
- Calling events by name
- Java concurrent api based event calls
- Flexible and convenient implementation
dependencies {
implementation group: 'io.github.amayaframework', name: 'amaya-events', version: 'LATEST'
}
<dependency>
<groupId>io.github.amayaframework</groupId>
<artifactId>amaya-events</artifactId>
<version>LATEST</version>
</dependency>
import io.github.amayaframework.events.*;
import java.util.concurrent.ForkJoinPool;
public class Main {
public static void main(String[] args) throws InterruptedException {
final var event = Event.of("CountEvent", Integer.class);
var factory = new ParallelManagerFactory(ForkJoinPool::commonPool);
var manager = factory.create();
manager.set(event, count -> System.out.println("The count is now " + count));
manager.fireNow(event, 5);
manager.stop();
}
}
This code will output:
The count is now 5
- RomanQed - Main work
See also the list of contributors who participated in this project.
This project is licensed under the Apache License 2.0 - see the LICENSE file for details