Skip to content

Aether Events is a powerful asynchronous event system for the JVM. It enables modular and flexible event processing with support for synchronous and asynchronous events, event pipelines, and cancellable events.

License

Notifications You must be signed in to change notification settings

aether-framework/aether-events

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

3 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

License Splatgames Nexus Version

Aether Events πŸš€

Aether Events is a powerful asynchronous event system for the JVM. It enables modular and flexible event processing with support for synchronous and asynchronous events, event pipelines, and cancellable events.


✨ Features

βœ… EventBus for centralized event and listener management
βœ… Event Pipelines for filtering, prioritization, and processing
βœ… Asynchronous Events with multi-threading support
βœ… Cancellable Events to stop specific events
βœ… Thread Safety for parallel processing
βœ… Easy Integration, no complex dependencies required


πŸ“¦ Installation

Aether Events is available via Maven and Gradle.

Maven

There are two repositories available for Aether Events:

  • Libraries Repository (Pointer to Nexus): https://libraries.splatgames.de/
  • Nexus Repository: https://nexus.splatgames.de/repository/maven-public/
<repository>
    <id>splatgames.de</id>
    <url>https://libraries.splatgames.de/</url>
</repository>

<dependency>
    <groupId>de.splatgames.aether</groupId>
    <artifactId>aether-events</artifactId>
    <version>1.0.0</version>
</dependency>

Gradle

repositories {
    maven {
        url 'https://libraries.splatgames.de/'
    }
}

dependencies {
    implementation 'de.splatgames.aether:aether-events:1.0.0'
}

πŸš€ Quick Start

1️⃣ Creating an EventBus

EventBus eventBus = EventBus.builder().build();

2️⃣ Registering a Listener

eventBus.subscribe(new TestListener());

3️⃣ Firing an Event

MyEvent event = new MyEvent(42);
eventBus.createPipeline("test:pipeline").fire(event);

🎯 Event Pipelines

Event Pipelines allow flexible event processing with filtering and prioritization:

EventPipeline<MyEvent> pipeline = eventBus.createPipeline("customPipeline");

pipeline
    .filter(event -> event.getExampleValue() > 0)
    .sorted(Comparator.comparing(MyEvent::getExampleValue))
    .registerConsumer(event -> System.out.println("Event received: " + event.getExampleValue()));

pipeline.fire(new MyEvent(10));

⚑ Asynchronous Events

Events can be processed asynchronously:

Thread thread = new Thread(() -> {
    EventPipeline<AsyncMyEvent> asyncPipeline = eventBus.createPipeline("test:asyncPipeline");
    asyncPipeline.fire(new AsyncMyEvent(99));
});

thread.start();

❌ Cancellable Events

An event can be canceled before it is processed:

MyCancellableEvent cancellableEvent = new MyCancellableEvent();

EventPipeline<MyCancellableEvent> cancellablePipeline = eventBus.createPipeline("test:cancellablePipeline");
cancellablePipeline.fire(cancellableEvent);

if (cancellableEvent.isCancelled()) {
    System.out.println("The event was cancelled!");
}

πŸ›  Listener Example

A simple listener that receives events:

public class TestListener implements Listener {
    
    @Subscribe
    public void onMyEvent(final MyEvent event) {
        System.out.println("MyEvent: " + event.getExampleValue());
    }
    
    @Subscribe
    public void onAsyncMyEvent(final AsyncMyEvent event) {
        System.out.println("AsyncMyEvent: " + event.getExampleValue());
    }
    
    @Subscribe
    public void onMyCancellableEvent(final MyCancellableEvent event) {
        event.setCancelled(true);
        System.out.println("MyCancellableEvent was cancelled");
    }
}

πŸ“’ Latest Release

  • πŸš€ Version: 1.0.0
  • πŸ“… Release Date: March 5, 2025
  • πŸ“¦ Available on: Splatgames Nexus

🀝 Contributing

We welcome contributions! πŸŽ‰
Please check out our CONTRIBUTING.md for guidelines on how to contribute.


πŸ“œ License

Aether Events is released under the MIT License.

MIT License

Copyright (c) 2025 Splatgames.de Software

Permission is hereby granted, free of charge, to any person obtaining a copy of this software...

🌟 Conclusion

Aether Events is a powerful solution for event-driven architectures on the JVM. It offers high flexibility, asynchronous processing, and a modern API for easy integration.

πŸ”₯ Get started with Aether Events now! πŸš€

About

Aether Events is a powerful asynchronous event system for the JVM. It enables modular and flexible event processing with support for synchronous and asynchronous events, event pipelines, and cancellable events.

Resources

License

Code of conduct

Contributing

Security policy

Stars

Watchers

Forks

Packages

No packages published

Languages