1.3.0 • Published 2 years ago

@workpuls/electron-rpc v1.3.0

Weekly downloads
-
License
MIT
Repository
-
Last release
2 years ago

Electron RPC

Module for easy electron RPC communication between main process, workers and all windows at the same time. It is using main process as message broker and both events and messages are send and forget.

How to install

Installation

npm install @workpuls/electron-rpc --save 

In each process you have to init broker, and it is important not to forget to do the same in main process.

import { Broker } from '@workpuls/electron-rpc';
Broker.init();

Broker

Broker is used for cross-process communication.

emit - for emitting events call - calling remote function/procedure, returning promise so that function can have return value

on - action that needs to be done once event is detected handle - handling call that's done and function return is what is resolved as promise

remove - removes any handler that is registered bboth with on and handle

Action can be handled just by one process and thats either main process or window that has solved execution first. If you need multiple processes to do the same action use emit.

RemoteSubject

RemoteSubject is same as BehaviourSubject, but data is synched betweenn multiple process. If inside one precess is called .next(value), same value will be propagated to all process.

It is uniquly identified by name.

1.2.0

2 years ago

1.1.0

2 years ago

1.0.0

2 years ago

1.3.0

2 years ago

1.2.1

2 years ago

0.3.1

4 years ago

0.3.0

4 years ago

0.2.12

5 years ago

0.2.11

5 years ago

0.2.10

5 years ago

0.2.9

5 years ago

0.2.8

5 years ago

0.2.7

5 years ago

0.2.6

5 years ago

0.2.5

5 years ago

0.2.4

5 years ago

0.2.3

5 years ago

0.2.2

5 years ago

0.2.1

5 years ago

0.2.0

5 years ago