Good Place library: Shawn

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

Shawn has started as Janet clone of the Reactive Streams library funcool/potok for Clojure[Script]. But after the 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 the application's state, or its part, named Envelope. The Envelope can be mutated only from the Act, and the Update Act is the only sanctioned type of the four:

  • Spy Act: it creates Snoops, called after every :update method call.
  • 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 produces effects outside of the Envelope.

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

Package: shawn Good Place 2021 All rights rejected