1.16.2 • Published 7 years ago

@theatersoft/bus v1.16.2

Weekly downloads
5
License
AGPL-3.0
Repository
github
Last release
7 years ago

bus

This message bus is the foundation of the Theatersoft platform. It enables communication between host Node.js servers and client web browsers to create a distributed application using modern Javascript.

Example: Ping Service

This demonstrates a simple ping method call between two bus nodes.

In this doc, node may refer to either Node.js or a node element of a bus network, depending on context.

First, install the package: npm install @theatersoft/bus.

Terminal 1

Start node and enter:

const {bus} = require('@theatersoft/bus')
bus.start({children: {host: 'localhost', port: 5453}})

This root bus node is now listening for child connections to localhost:5453.

Register a bus object Ping with one method ping:

bus.registerObject('Ping', {ping: () => 'PING!'})

Terminal 2

Open another terminal, start another node, and run:

const {bus} = require('@theatersoft/bus')
bus.start({parent: 'ws://localhost:5453'})

This child bus node is now connected to the parent.

Call the method on the bus object running in terminal 1:

const Ping = bus.proxy('Ping')
Ping.ping().then(value => console.log(value))

PING!

Documentation and Support

https://www.theatersoft.com/docs/developers/bus/

https://www.theatersoft.com/community

1.16.2

7 years ago

1.16.1

7 years ago

1.16.0

8 years ago

1.15.0

8 years ago

1.14.0

8 years ago

1.13.3

8 years ago

1.13.2

8 years ago

1.13.1

8 years ago

1.13.0

8 years ago

1.12.15

8 years ago

1.12.14

8 years ago

1.12.13

8 years ago

1.12.12

8 years ago

1.12.11

8 years ago

1.12.10

8 years ago

1.12.9

8 years ago

1.12.8

8 years ago

1.12.7

8 years ago

1.12.6

8 years ago

1.12.5

8 years ago

1.12.4

8 years ago

1.12.3

8 years ago

1.12.2

8 years ago

1.12.1

8 years ago

1.12.0

8 years ago

1.10.0

8 years ago

1.9.1

9 years ago

1.9.0

9 years ago

1.8.1

9 years ago

1.8.0

9 years ago

1.7.1

9 years ago

1.7.0

9 years ago

1.6.4

9 years ago

1.6.3

9 years ago

1.6.2

9 years ago

1.6.1

9 years ago

1.6.0

9 years ago

1.5.1

9 years ago

1.5.0

9 years ago

1.4.0

9 years ago

1.3.3

9 years ago

1.3.2

9 years ago

1.3.1

9 years ago

1.3.0

9 years ago

1.2.2

9 years ago

1.2.1

9 years ago

1.2.0

9 years ago

1.1.0

9 years ago

1.0.0

9 years ago