Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/felixklauke/caroline
Introduce RxJava into spigot and bungeecord on enterprise level. Also provides full feature binding adapters for spigot events, commands and protocollib packet adapters to bring spigot and bungeecord development with reactive pattern onto a new stage.
https://github.com/felixklauke/caroline
adapter binding command events library protocollib rxjava rxjava2 spigot
Last synced: 2 months ago
JSON representation
Introduce RxJava into spigot and bungeecord on enterprise level. Also provides full feature binding adapters for spigot events, commands and protocollib packet adapters to bring spigot and bungeecord development with reactive pattern onto a new stage.
- Host: GitHub
- URL: https://github.com/felixklauke/caroline
- Owner: felixklauke
- License: mit
- Created: 2018-01-23T09:52:04.000Z (almost 7 years ago)
- Default Branch: dev
- Last Pushed: 2023-05-15T05:10:37.000Z (over 1 year ago)
- Last Synced: 2024-10-12T03:50:48.501Z (3 months ago)
- Topics: adapter, binding, command, events, library, protocollib, rxjava, rxjava2, spigot
- Language: Java
- Homepage: http://felix-klauke.de
- Size: 110 KB
- Stars: 17
- Watchers: 4
- Forks: 0
- Open Issues: 6
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
# caroline
Ever tried using the java version of the reactive extensions ( https://github.com/ReactiveX/RxJava ) in a minecraft
bukkit server? Yes? Then you may know what this is and why you need it. Without any modifications its very
unlikely that your server will run very long. Using this pluginManager you can schedule rx javas internal thread architecture
on bukkit schedulers to make rxjava usable in general. Have fun using this.# Build Status
| | Build Status | Test Code Coverage |
|------------- |----------------------------------------------------------------------------------------------------------------------------------------------------------- |------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| Master | [![Build Status](https://travis-ci.org/FelixKlauke/caroline.svg?branch=master)](https://travis-ci.org/FelixKlauke/caroline) | [![codecov](https://codecov.io/gh/FelixKlauke/caroline/branch/master/graph/badge.svg)](https://codecov.io/gh/FelixKlauke/caroline) |
| Development | [![Build Status](https://travis-ci.org/FelixKlauke/caroline.svg?branch=dev)](https://travis-ci.org/FelixKlauke/caroline) | [![codecov](https://codecov.io/gh/FelixKlauke/caroline/branch/dev/graph/badge.svg)](https://codecov.io/gh/FelixKlauke/caroline) |# Usage
- Install [Maven](http://maven.apache.org/download.cgi)
- Clone this repo
- Install: ```mvn clean install```**Maven repositories**
```xml
klauke-enterprises-maven-releases
Klauke Enterprises Maven Releases
https://repository.klauke-enterprises.com/repository/maven-releases/
klauke-enterprises-maven-snapshots
Klauke Enterprises Maven Snapshots
https://repository.klauke-enterprises.com/repository/maven-snapshots/
```
**Maven dependencies**
_Caroline Core:_
```xmlde.felixklauke.caroline
caroline-core
1.2.0```
# Example## Event Example
_Plain old listener:_
```java
RxCaroline.observeEvent(PlayerJoinEvent.class).subscribe(event -> {
event.setJoinMessage("A new player joined: " + event.getPlayer().getName());
});
```_Use a specific priority:_
```java
RxCaroline.observeEvent(PlayerJoinEvent.class, EventPriority.LOWEST).subscribe(event -> {
event.setJoinMessage("A new player joined: " + event.getPlayer().getName());
});
```_Ignore cancelled events:_
```java
RxCaroline.observeEvent(PlayerJoinEvent.class, true).subscribe(event -> {
event.setJoinMessage("A new player joined: " + event.getPlayer().getName());
});
```_Both at the same time:_
```java
RxCaroline.observeEvent(PlayerJoinEvent.class, EventPriority.LOWEST, true).subscribe(event -> {
event.setJoinMessage("A new player joined: " + event.getPlayer().getName());
});
```## Command Example
## Packet Adapter example
# Architecture
We use google guice ( https://github.com/google/guice ) for dependency injection. You should have a look at that
before you consider touching our architecture. The guice dependencies are defined in the
`CarolineModule`. The bukkit pluginManager will create an instance of the main
application using the guice injector. The main application will hook our schedulers into rx java. Currently
we support
- Computation Scheduler (synchronous)
- IO Scheduler (asynchronous)
- New Thread Scheduler (asynchronous)
and configure rx java to use them. The tasks executed by these scheduler will be mapped on bukkits internal
scheduler architecture.