Decstreams – Decorator Streams for Asynchronous, Multicast, and Functionally Decoupled Event Driven Architectures on the Front End

ZVS is open sourcing our client-popular library decstreams. We have been using decstreams in ours and clients JS based systems, including react, angular, and vue based apps, to bring decorator multicast streaming patterns to front end development, similar to backend patterns like kafka or sanicio, while simultaneously simplifying architectures using the experimental Javascript decorator patterns.

Decstreams is backed by RxJs Subjects and implemented as request and event publish/consumer pairs. Requests or Events can be published by one function and then consumed by others; multi-cast events allow many event consumers to consume the same event publisher, and requests can publish to many consumers for responses, passing optional arbitrary arguments along with them.

A very common use case for decstreams is to do multicast event publishing after SPWA interaction (say, map movement, graph alteration, button pushing) – triggering other edge behaviors, sending data to a back end, updating local in-memory data, etc., simultaneously, while avoiding adding business logic or direct function calls to either. Similarly, when interaction requires a response, requests can multicast to multiple request consumers, passing any relevant information along, wait for all data to be returned, and then act on the new information.

Decstreams is most readily available in the node package manager – npm install decstreams – and copy/paste README examples are available in on the ZVS github page – https://github.com/zeus-volkov-systems/decstreams.

We hope you enjoy decstreams and it works as well for you as it has for us in our client’s systems – it really is a joy to begin to decouple systems at this level of abstraction.

Cheers!

Ryan, Max, and Nadia

Leave a Comment