Coder Social home page Coder Social logo

pwittchen / reactivebus Goto Github PK

View Code? Open in Web Editor NEW
17.0 3.0 4.0 152 KB

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

License: Apache License 2.0

Java 100.00%
rxjava rxjava2 rxandroid rxandroid2 event bus eventbus

reactivebus's Introduction

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.

reactivebus's People

Contributors

davidmoten avatar dependabot-preview[bot] avatar pwittchen avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

reactivebus's Issues

release 0.0.5

Initial release notes:

  • Improved builder pattern in the Event class - PR #10

things to do:

  • bump library version
  • publish artifact to sonatype
  • close and release artifact on sonatype
  • update changelog after maven sync
  • update download section after maven sync
  • publish new release on GitHub

release 0.0.4

Initial release notes:

  • Replacing factory methods with builder pattern in Event class - issue #7, PR #8

things to do:

  • bump library version
  • publish artifact to sonatype
  • close and release artifact on sonatype
  • update changelog after maven sync
  • update download section after maven sync
  • publish new release on GitHub

release 0.0.2

Initial release notes:

  • made event bus thread safe by making PublishSubject serializable - PR #1
  • added possibility to pass Serializable data via Event - PR #3

things to do:

  • bump library version
  • publish artifact to sonatype
  • release artifact on sonatype
  • update changelog after maven sync
  • update download section after maven sync
  • publish new release

add annotation processor for handling events

Add annotation processor for handling events (similar to the Guava or Otto event bus), which will accept reactive events. It should be optional feature added as a separate artifact. Actually it can be treated like syntactic sugar or way of delegating event handling into a different methods.

release 0.0.3

Initial release notes:

  • Reducing overhead by casting result and removing mapping - PR #5

things to do:

  • bump library version
  • publish artifact to sonatype
  • release artifact on sonatype
  • update changelog after maven sync
  • update download section after maven sync
  • publish new release on GitHub

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.