CSP are a pattern for concurrent programming that involves two key abstractions:
Processes: are tasks that are, in general, executed concurrently. The code defining a Process is executed sequentially.
Channels: are first-in first-out (FIFO) queues that are used for communication between Processes. You put an element into a Channel via the operation
put
and take an element out of a channel via the operationtake
.From Communicating Sequential Processes: an alternative to async generators
These examples are from Joe Harlow's video Implementation of CSP
The libraries used are @paybase/csp, and @paybase/pool, though Joe does go through a rudimentary implementation of @paybase/csp in the video