Good Place library: Shawn

In the Good Place series, Shawn was the daemon from the Bad Place.

Shawn has started as Janet clone of the Reactive Streams library funcool/potok for Clojure[Script]. But after ev module was added into the language core, we redesigned this library to align better with the functionality of the module.

The basic idea is to have Shawn which contains state of the application, or its part, named Envelope. All the changes to the state can be only done with Act which is similar to the event in the potok. Also the three kinds are very similar:

  • Update Act: it modifies the envelope based on the state of it and its arguments.
  • Watch Act: it generates more acts, which are then added to the stream and processed later.
  • Effect Act: it producess effects outside of the envelope.

But there is one more thing, that Watch Acts can do: generate cocoons, in which you can have longer running processes and servers.

Package: shawn Good Place 2021 All rights rejected