reactivebus

Simple Reactive Event Bus for JVM (1.7+) and Android apps built with RxJava 2

License

License

Categories

Categories

React User Interface Web Frameworks
GroupId

GroupId

com.github.pwittchen
ArtifactId

ArtifactId

reactivebus
Last Version

Last Version

0.0.5
Release Date

Release Date

Type

Type

jar
Description

Description

reactivebus
Simple Reactive Event Bus for JVM (1.7+) and Android apps built with RxJava 2
Project URL

Project URL

https://github.com/pwittchen/ReactiveBus
Source Code Management

Source Code Management

https://github.com/pwittchen/ReactiveBus

Download reactivebus

How to add to project

<!-- https://jarcasting.com/artifacts/com.github.pwittchen/reactivebus/ -->
<dependency>
    <groupId>com.github.pwittchen</groupId>
    <artifactId>reactivebus</artifactId>
    <version>0.0.5</version>
</dependency>
// https://jarcasting.com/artifacts/com.github.pwittchen/reactivebus/
implementation 'com.github.pwittchen:reactivebus:0.0.5'
// https://jarcasting.com/artifacts/com.github.pwittchen/reactivebus/
implementation ("com.github.pwittchen:reactivebus:0.0.5")
'com.github.pwittchen:reactivebus:jar:0.0.5'
<dependency org="com.github.pwittchen" name="reactivebus" rev="0.0.5">
  <artifact name="reactivebus" type="jar" />
</dependency>
@Grapes(
@Grab(group='com.github.pwittchen', module='reactivebus', version='0.0.5')
)
libraryDependencies += "com.github.pwittchen" % "reactivebus" % "0.0.5"
[com.github.pwittchen/reactivebus "0.0.5"]

Dependencies

runtime (1)

Group / Artifact Type Version
io.reactivex.rxjava2 : rxjava jar 2.1.10

test (2)

Group / Artifact Type Version
junit : junit jar 4.12
com.google.truth : truth jar 0.27

Project Modules

There are no modules declared in this project.

ReactiveBus Build Status codecov Maven Central Android Arsenal

๐Ÿš Simple Reactive Event Bus for JVM (1.7+) and Android apps built with RxJava 2

Usage

Bus bus = ReactiveBus.create(); // creating thread safe instance of event bus

Disposable observer = bus.receive().subscribe(new Consumer<Event>() {
    @Override public void accept(Event event) {
      // handle event here
    }
  });

// send a message only (with random id)
bus.send(Event.name("my event 1").build());

// send some data (with random id)
bus.send(Event.name("my event 2").data(serializableObject).build());

// send id, name and some data
bus.send(Event.id("myId").name("my event 3").data(serializableObject).build());

observer.dispose(); // after disposal, observer will stop receiving new events

Download

You can depend on the library through Maven:

<dependency>
    <groupId>com.github.pwittchen</groupId>
    <artifactId>reactivebus</artifactId>
    <version>0.0.5</version>
</dependency>
<dependency>
    <groupId>io.reactivex.rxjava2</groupId>
    <artifactId>rxjava</artifactId>
    <version>2.1.10</version>
</dependency>

or through Gradle:

implementation 'com.github.pwittchen:reactivebus:0.0.5'
implementation 'io.reactivex.rxjava2:rxjava:2.1.10'

Code style

Code style used in the project is called Square from Java Code Styles repository by Square

available at: https://github.com/square/java-code-styles.

Building, tests and static code analysis

To build project, type:

./gradlew build

To run tests, type:

./gradlew test

To run static code analysis, type:

./gradlew check

References

License

Copyright 2018 Piotr Wittchen

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

   http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

Versions

Version
0.0.5
0.0.4
0.0.3
0.0.2
0.0.1