✌️Welcome!

What is this library about?

Revolver CSP library is heavily inspired by Clojure's core.async library that implements a Communicating Sequential Processes pattern. It provides yet another way to handle asynchronous code in highly interactive Javascript/Typescript applications. The main feature of this library is that it helps you to decompose your system by using routines and channels. These two entities mean and function very similar to ones in Clojure's core.async and Golang's standard library which also adopted the same pattern as a language's first-class citizen. In JavaScript implmentation I chose to model routines by using generator functions which allow us to create a sense of "parallel" execution because of generator's ability to "pause" and "continue". Channels, in turn, are modelled as a plain objects.

Why this library was created?

The prime purpose of this library is an educational one. I have created this library to challenge myself by making an alternative to RxJS and to learn more about CSP pattern in general. While Javascript has quite a few libraries to offer when it comes to async programming, most of them are designed to be used only on frontend or backend side of things. I have attempted to solve this, but still stumbled upon an absence of setImmediate API in browser and found no inspiration and time to resolve this issue. The only popular library which is, let's say, "layer agnostic" is RxJS and it is great. While it is being a well established tool with a huge API, proven reputation and written by people that are far more clever then myself, I believe that there should be more alternatives in async javascript world at least on a "pattern" level. Functional reactive programming is a useful tool and fits into frontend development very smoothly and naturally, but it has its own drawbacks. What do you do when a library or a pattern does not solve the problem the way you want it to? You just search for another one! That's why I have picked a pattern which in my humble opinion has far more capabilities in a certain set of cases comparing to FRP and fits nicely into both frontend and backend development.

This library is not intended for production use as of now.

Last updated