4.5.0 • Published 8 months ago

@superhero/eventflow-hub v4.5.0

Weekly downloads
-
License
MIT
Repository
github
Last release
8 months ago

Eventflow Hub

Eventflow Hub is a central component of the Eventflow system that manages mTLS-secured connections between spokes and peer hubs, facilitating message publishing, subscription handling, and event scheduling.

!NOTE This module is still under development and in activing testing.

Features

  • TLS-Secured Communication: Ensures secure connections using certificates for both server and client communication.
  • Event Management: Publishes and broadcasts events to subscribed spokes and peer hubs.
  • Subscriber Management: Tracks spokes subscribing to specific events.
  • Scheduled Events: Executes scheduled tasks with error handling and persistence.
  • Scalable Architecture: Supports multi-hub communication for distributed systems.

Testing

Run the test suite using:

npm run test-build
npm test

Test Coverage

▶ @superhero/eventflow-hub
  ▶ Lifecycle
    ✔ Can initialize EventflowHub correctly (239.24859ms)
  ✔ Lifecycle (240.434564ms)

  ▶ Connections and Communication
    ▶ Handles spoke connections
      ✔ Broadcasts peer hub online event (6422.456966ms)
    ✔ Handles spoke connections (12880.167996ms)
  ✔ Connections and Communication (12880.634724ms)
✔ @superhero/eventflow-hub/hub (13122.085188ms)

▶ @superhero/eventflow-hub/manager/spokes
  ✔ Add and retrieve all sockets (3.451128ms)
  ✔ Delete a socket (0.227951ms)
  ✔ Destroy all sockets (0.352411ms)
  ✔ Handle deleting non-existent socket gracefully (0.275818ms)
  ✔ Return empty array if no sockets exist (0.165647ms)
✔ @superhero/eventflow-hub/manager/spokes (6.103143ms)

▶ @superhero/eventflow-hub/manager/subscribers
  ✔ Add and retrieve subscribers (2.384233ms)
  ✔ Handle wildcard subscribers (0.308446ms)
  ✔ Return empty array if no subscribers exist (0.152296ms)
  ✔ Delete a subscriber and clean up empty structures (0.243432ms)
  ✔ Clean up domain and event mappings after deletion (0.226052ms)
  ✔ Not throw errors when deleting non-existent subscribers (0.362547ms)
✔ @superhero/eventflow-hub/manager/subscribers (5.36466ms)

tests 14
suites 5
pass 14

-------------------------------------------------------------------------------------------------------------
file                    | line % | branch % | funcs % | uncovered line
-------------------------------------------------------------------------------------------------------------
config.js               | 100.00 |   100.00 |  100.00 | 
index.js                |  73.36 |    74.42 |   74.07 | 44-47 120-124 144-146 150-154 157-161 183-185 254-2…
index.test.js           | 100.00 |   100.00 |  100.00 | 
manager                 |        |          |         | 
 spokes.js              | 100.00 |   100.00 |  100.00 | 
 spokes.test.js         | 100.00 |   100.00 |  100.00 | 
 subscribers.js         |  78.21 |   100.00 |   83.33 | 61-77
 subscribers.test.js    | 100.00 |   100.00 |  100.00 | 
-------------------------------------------------------------------------------------------------------------
all files               |  82.97 |    86.32 |   87.50 |
-------------------------------------------------------------------------------------------------------------

License

This project is licensed under the MIT License.

Contributing

Feel free to submit issues or pull requests for improvements or additional features.

4.4.9

10 months ago

4.4.8

10 months ago

4.3.9

11 months ago

4.4.5

10 months ago

4.3.6

11 months ago

4.0.9

11 months ago

4.4.4

10 months ago

4.3.5

11 months ago

4.0.8

11 months ago

4.4.7

10 months ago

4.3.8

11 months ago

4.4.6

10 months ago

4.3.7

11 months ago

4.3.10

10 months ago

4.5.0

8 months ago

4.4.10

9 months ago

4.4.1

10 months ago

4.3.2

11 months ago

4.4.0

10 months ago

4.4.3

10 months ago

4.3.4

11 months ago

4.0.10

11 months ago

4.3.3

11 months ago

4.4.14

9 months ago

4.4.12

9 months ago

4.3.0

11 months ago

4.4.11

9 months ago

4.0.16

11 months ago

4.0.15

11 months ago

4.0.17

11 months ago

4.0.12

11 months ago

4.0.11

11 months ago

4.0.14

11 months ago

4.0.13

11 months ago

4.0.7

12 months ago

4.0.5

1 year ago

4.0.6

12 months ago

4.0.4

1 year ago

4.0.3

1 year ago

4.0.2

1 year ago