Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/amayaframework/amaya-events
A library that implements the event system.
https://github.com/amayaframework/amaya-events
async event event-system events java java-11 java-17 java-21 system
Last synced: about 1 month ago
JSON representation
A library that implements the event system.
- Host: GitHub
- URL: https://github.com/amayaframework/amaya-events
- Owner: AmayaFramework
- License: apache-2.0
- Created: 2024-03-05T13:03:21.000Z (9 months ago)
- Default Branch: main
- Last Pushed: 2024-03-14T13:08:29.000Z (8 months ago)
- Last Synced: 2024-10-13T04:03:09.316Z (about 1 month ago)
- Topics: async, event, event-system, events, java, java-11, java-17, java-21, system
- Language: Java
- Homepage:
- Size: 46.9 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# amaya-events [![maven-central](https://img.shields.io/maven-central/v/io.github.amayaframework/amaya-events?color=blue)](https://repo1.maven.org/maven2/io/github/amayaframework/amaya-events/)
A library that implements the event system.
## Getting Started
To install it, you will need:
* Java 11+
* Maven/Gradle### Features
* Universal event descriptor
* Calling events by name
* Java concurrent api based event calls
* Flexible and convenient implementation## Installing
### Gradle dependency
```Groovy
dependencies {
implementation group: 'io.github.amayaframework', name: 'amaya-events', version: 'LATEST'
}
```### Maven dependency
```
io.github.amayaframework
amaya-events
LATEST```
## Usage example
```Java
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
```## Built With
* [Gradle](https://gradle.org) - Dependency management
* [jfunc](https://github.com/RomanQed/jfunc) - Functional interfaces, utilities## Authors
* **[RomanQed](https://github.com/RomanQed)** - *Main work*
See also the list of [contributors](https://github.com/AmayaFramework/amaya-events/contributors)
who participated in this project.## License
This project is licensed under the Apache License 2.0 - see the [LICENSE](LICENSE) file for details