RxBus Android

Event bus running on type safe RxJava queues

License

License

Categories

Categories

Net
GroupId

GroupId

net.jokubasdargis.rxbus
ArtifactId

ArtifactId

rxbus-android
Last Version

Last Version

2.0.0
Release Date

Release Date

Type

Type

aar
Description

Description

RxBus Android
Event bus running on type safe RxJava queues
Project URL

Project URL

https://github.com/eleventigers/rxbus
Source Code Management

Source Code Management

https://github.com/eleventigers/rxbus

Download rxbus-android

How to add to project

<!-- https://jarcasting.com/artifacts/net.jokubasdargis.rxbus/rxbus-android/ -->
<dependency>
    <groupId>net.jokubasdargis.rxbus</groupId>
    <artifactId>rxbus-android</artifactId>
    <version>2.0.0</version>
    <type>aar</type>
</dependency>
// https://jarcasting.com/artifacts/net.jokubasdargis.rxbus/rxbus-android/
implementation 'net.jokubasdargis.rxbus:rxbus-android:2.0.0'
// https://jarcasting.com/artifacts/net.jokubasdargis.rxbus/rxbus-android/
implementation ("net.jokubasdargis.rxbus:rxbus-android:2.0.0")
'net.jokubasdargis.rxbus:rxbus-android:aar:2.0.0'
<dependency org="net.jokubasdargis.rxbus" name="rxbus-android" rev="2.0.0">
  <artifact name="rxbus-android" type="aar" />
</dependency>
@Grapes(
@Grab(group='net.jokubasdargis.rxbus', module='rxbus-android', version='2.0.0')
)
libraryDependencies += "net.jokubasdargis.rxbus" % "rxbus-android" % "2.0.0"
[net.jokubasdargis.rxbus/rxbus-android "2.0.0"]

Dependencies

compile (3)

Group / Artifact Type Version
io.reactivex : rxandroid jar 1.2.1
net.jokubasdargis.rxbus : rxbus jar 2.0.0
com.android.support » support-annotations jar 23.1.0

Project Modules

There are no modules declared in this project.

RxBus

Event bus running on type safe RxJava queues

Download

Gradle:

compile 'net.jokubasdargis.rxbus:rxbus:2.0.0'

// Optional
compile 'net.jokubasdargis.rxbus:rxbus-android:2.0.0'
compile 'net.jokubasdargis.rxbus:rxbus-dispatcher:2.0.0'

Snapshots of the development version are available in Sonatype's snapshots repository.

Usage

Basic use - event delivery transport tightly coupled by an event type

  • Create a default bus

    Bus bus = RxBus.create();

    or if you are on Android:

    Bus bus = RxAndroidBus.create();
  • Prepare a Queue for an event type. You might want to maintain a collection of static queues as:

    public final class Queues {
      public static final Queue<Event> TRACKING  = Queue.of(TrackingEvent.class).build();
    }
  • Use a queue when subscribing

    Subscription subscription = bus.subscribe(Queues.TRACKING, new Observer<Event> {
      ...
      @Override
      public void onNext(TrackingEvent event) {
        // do something with the event
      }
    })
  • and publishing:

    bus.publish(Queues.TRACKING, new TrackingEvent())

Origin

Adapted from Soundcloud's reactive bus appraoch as seen in mttkay's Reactive Soundcloud slides:

bus

bus

License

Copyright 2016 Jokubas Dargis

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
2.0.0
1.2.0
1.1.2