> For the complete documentation index, see [llms.txt](https://roman-sarder.gitbook.io/csp-coffee/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://roman-sarder.gitbook.io/csp-coffee/welcome.md).

# Welcome!

## What is this library about?&#x20;

Revolver CSP library is heavily inspired by Clojure's [core.async](https://github.com/clojure/core.async) library that implements a [Communicating Sequential Processes](https://en.wikipedia.org/wiki/Communicating_sequential_processes#:~:text=In%20computer%20science%2C%20communicating%20sequential,on%20message%20passing%20via%20channels.) 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](https://rxjs.dev/) 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.

{% hint style="warning" %}
**This library is not intended for production use as of now.**
{% endhint %}
