All Projects → NewtronLabs → IpcEventBus

NewtronLabs / IpcEventBus

Licence: other
Faster than Intents and easier than AIDLs.

Programming Languages

java
68154 projects - #9 most used programming language

Projects that are alternatives of or similar to IpcEventBus

Apollo
🚀 Awesome EventBus by RxJava.
Stars: ✭ 329 (+840%)
Mutual labels:  ipc, eventbus
mvp4g
A framework to build a gwt application the right way
Stars: ✭ 29 (-17.14%)
Mutual labels:  eventbus
qtalk-go
versatile stream IO and RPC based IPC stack for Go
Stars: ✭ 29 (-17.14%)
Mutual labels:  ipc
sirdez
Glorious Binary Serialization and Deserialization for TypeScript.
Stars: ✭ 20 (-42.86%)
Mutual labels:  ipc
kitti3
Kitty drop-down service for sway & i3wm
Stars: ✭ 73 (+108.57%)
Mutual labels:  ipc
game-executor
采用Reactor模式,注册readycreate, readyfinish事件到更新服务UpdateService,通过处理后进行模型缓存,然后将消息转化为 dispatchThread消息分配模型需要的create, update, finish的事件进行单线程循环调度 。调度过程使用了系统预置锁模型,来进行多线程唤醒机制,将所有的update循环检测进行多 线程调度,多线程更新服务使用future-listener机制,在完成调度后,根据模型状态,如果模型存活重新将消息转化为update 事件注册到dispatchThread消息分配模型进行循环处理。如果模型死亡将消息转化为readyfinish事件注册到更新服务UpdateServic进行销毁 。这个系统实现了模型自动缓存,多…
Stars: ✭ 28 (-20%)
Mutual labels:  eventbus
ipc-toolkit
A set of reusable functions to integrate IPC into an existing simulation.
Stars: ✭ 84 (+140%)
Mutual labels:  ipc
DelphiEventBus
Implementation of event bus pattern for Delphi XE
Stars: ✭ 32 (-8.57%)
Mutual labels:  eventbus
vxrifa
Utility library for Vert.X that allows using strong-typed interfaces in communication through EventBus
Stars: ✭ 15 (-57.14%)
Mutual labels:  eventbus
microservice-architecture-quick-start
Demonstrates how to build a Microservices Architecture using the C # language and the ASP.NET Core environment.
Stars: ✭ 16 (-54.29%)
Mutual labels:  eventbus
ModernOperatingSystems AndrewTanenbaum
My notes after reading 'Modern Operating Systems' book by Andrew Tanenbaum and Herbert Bos.
Stars: ✭ 71 (+102.86%)
Mutual labels:  ipc
Alpine
Basic event system framework using functional interfaces
Stars: ✭ 79 (+125.71%)
Mutual labels:  eventbus
MASA.Contrib
The purpose of MASA.Contrib is based on MASA.BuildingBlocks to provide open, community driven reusable components for building mesh applications. These components will be used by the MASA Stack and MASA Labs projects.
Stars: ✭ 102 (+191.43%)
Mutual labels:  eventbus
CEventCenter
一个Android事件分发中心库,基于对象池及接口回调实现。实现类似BroadcastReceiver/RxBus/EventBus等的消息事件传递功能,用于在Activity/Fragment/Service之间的消息传递通讯。
Stars: ✭ 116 (+231.43%)
Mutual labels:  eventbus
IPC.Bond
IPC.Bond is an extension of IPC library that provides inter-process communication using shared memory on Windows with Bond serialization.
Stars: ✭ 26 (-25.71%)
Mutual labels:  ipc
eth-provider
A Universal Ethereum Provider Client
Stars: ✭ 139 (+297.14%)
Mutual labels:  ipc
vertx-vue-keycloak
This repo holds the source codes for the Medium Article "Vert.x + VueJS + OAuth2 in 5 steps"
Stars: ✭ 20 (-42.86%)
Mutual labels:  eventbus
node-svmq
Native System V message queues in Node.js
Stars: ✭ 16 (-54.29%)
Mutual labels:  ipc
ReactiveBus
🚍 Reactive Event Bus for JVM (1.7+) and Android apps built with RxJava 2
Stars: ✭ 17 (-51.43%)
Mutual labels:  eventbus
InterProcessCommunication
Inter-process Communication
Stars: ✭ 11 (-68.57%)
Mutual labels:  ipc

IPC EventBus

Faster than Intents and easier than AIDLs. IPC EventBus is an Android library for sending events between processes or different apps.


How to Use

Step 1

Include the below dependency in your build.gradle project.

buildscript {
    repositories {
        google()
        maven { url "https://newtronlabs.jfrog.io/artifactory/libs-release-local" }
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:7.0.4'
        classpath 'com.newtronlabs.android:plugin:5.0.2'
    }
}

allprojects {
    repositories {
        google()
        maven { url "https://newtronlabs.jfrog.io/artifactory/libs-release-local" }
    }
}

subprojects {
    apply plugin: 'com.newtronlabs.android'
}

In the build.gradle for your app include:

dependencies {
    compileOnly 'com.newtronlabs.ipceventbus:ipceventbus:6.0.2-alpha08'
}

Step 2

Implement IIpcEventBusConnectionListener and IIpcEventBusObserver.

public class Listener implements IIpcEventBusConnectionListener, IIpcEventBusObserver {
    public Listener() {
        String targetApp = "com.packagename";
        
        IIpcEventBusConnector connector =
                ConnectorFactory.getInstance().buildConnector(context, this, targetApp);
            
        connector.startConnection();
    }

    @Override
    public void onConnected(IIpcEventBusConnector connector) {
        connector.registerObserver(this);
    }

    @Override
    public void onEvent(IEventIpc event) {
        Log.d("ipceventbus", "Received event: " + event.getClass().getSimpleName());
    }

    @Override
    public void onDisconnected(IIpcEventBusConnector connector) {

    }
}

Step 3

IpcEventBus.getInstance().postEvent(new MyEvent());

Step 4

Create a module with all your events. Then share the module between the apps that will share the events. Ideally you would turn this module into an AAR for easy sharing.

Option A - Simple

The easiest way to create an event is to make your event extend EventIpcSimple so that all the setup happens in that super class.

public class EventExample extends EventIpcSimple {

    public EventExample() {
    }

    EventExample(Parcel in) {
        readFromParcel(in);
    }
}

Option B - Event containing object(s)

Sometimes it you may which to pass data inside of an event for it to be received on another app. To do this you have to use the ParcelHelper class that will do all the heavy lifting for you. The example below shows this. It also shows that interface types are preserved accross IPC.

public class EventExample extends EventIpcSimple {
    private IData mData;

    public EventExample(IData data) {
        mData = data;
    }

    EventExample(Parcel in) {
        readFromParcel(in);
    }

    @Override
    public void readFromParcel(Parcel parcel) {
        // Must be done for every object in the event.
        mData = (IData) ParcelHelper.getInstance().createFromParcel(parcel, IData.class);
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        // Must be done for every object in the event.
        ParcelHelper.getInstance().writeToParcel(dest, flags, mData);
    }

    public IData getData() {
        return mData;
    }
}

Option C - Advance mode

Sometimes you don't want your event to extend EventIpcSimple.

public class EventExample implements IEventIpc {
    public EventExample() {
    }

    EventExample(Parcel in) {
        readFromParcel(in);
    }
    
    public static final Creator<EventExample> CREATOR = new Creator<EventExample>() {
        @Override
        public EventExample createFromParcel(Parcel in) {
            return new EventExample(in);
        }

        @Override
        public EventExample[] newArray(int size) {
            return new EventExample[size];
        }
    };
    
     @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {        
    }

    public void readFromParcel(Parcel in) {
    }
}

Additional Samples

A set of more complex exmaples can be found in this repo's samples folders: App 1 and App 2.


Support Us

Please support the continued development of these libraries. We host and develop these libraries for free. Any support is deeply appriciated. Thank you!

Support us

BTC Address: 39JmAfnNhaEPKz5wjQjQQj4jcv9BM11NQb


License

IPC EventBus binaries and source code can only be used in accordance with Freeware license. That is, freeware may be used without payment, but may not be modified. The developer of IPC EventBus retains all rights to change, alter, adapt, and/or distribute the software. IPC EventBus is not liable for any damages and/or losses incurred during the use of IPC EventBus.

You may not decompile, reverse engineer, pull apart, or otherwise attempt to dissect the source code, algorithm, technique or other information from the binary code of IPC EventBus unless it is authorized by existing applicable law and only to the extent authorized by such law. In the event that such a law applies, user may only attempt the foregoing if: (1) user has contacted Newtron Labs to request such information and Newtron Labs has failed to respond in a reasonable time, or (2) reverse engineering is strictly necessary to obtain such information and Newtron Labs has failed to reply. Any information obtained by user from Newtron Labs may be used only in accordance to the terms agreed upon by Newtron Labs and in adherence to Newtron Labs confidentiality policy. Such information supplied by Newtron Labs and received by user shall not be disclosed to a third party or used to create a software substantially similar to the technique or expression of the Newtron Labs IPC EventBus software.

You are solely responsible for determining the appropriateness of using IPC EventBus and assume any risks associated with Your use of IPC EventBus. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall Newtron Labs be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the IPC EventBus (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if Newtron Labs has been advised of the possibility of such damages.

Patent Pending

Contact

[email protected]

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].