Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/kerner1000/events1000
Lightweight Event System
https://github.com/kerner1000/events1000
Last synced: about 2 months ago
JSON representation
Lightweight Event System
- Host: GitHub
- URL: https://github.com/kerner1000/events1000
- Owner: kerner1000
- License: apache-2.0
- Created: 2018-08-26T10:43:14.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2022-02-22T12:50:27.000Z (almost 3 years ago)
- Last Synced: 2024-05-01T14:53:33.833Z (8 months ago)
- Language: Java
- Size: 41 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# events1000
A Lightweight Event System.[![Build Status](https://travis-ci.org/kerner1000/events1000.svg?branch=master)](https://travis-ci.org/kerner1000/events1000)
[![codecov](https://codecov.io/gh/kerner1000/events/branch/master/graph/badge.svg)](https://codecov.io/gh/kerner1000/events1000)# Features
## Events can be visited or consumed
## Asynchronous, Synchronous and UI Events
## Event Topics may have (more generic) parent Topis# Usage
## Creating Objects
```
EventListener listener = new SynchronousEventListener() {@Override
public EventTopic getTopic() {
return EventTopic.get("test");
}@Override
public boolean visit(Event e) {
System.err.println("Hey there!");
return false;
}
};
Event event = new SynchronousEvent() {@Override
public UUID getUUID() {
return UUID.randomUUID();
}@Override
public EventTopic getTopic() {
return EventTopic.get("test");
}
};
```
## Register Listener
```
Events.getInstance().registerListener(listener);
```## Emit an Event
```
Events.getInstance().emit(event);
```
## Output
```
Hey there!
```