Hasty Briefsbeta

Clojure Async Flow Guide

6 days ago
  • #process-management
  • #flow-library
  • #step-functions
  • The flow library separates application logic from deployment concerns like topology, execution, and lifecycle.
  • Step functions (step-fns) are the core logic units, wrapped into processes managed by flow.
  • Step-fns have four arities: describe, init, transition, and transform, each serving a specific purpose in process management.
  • Process state is a map that can include flow-specific keys like ::flow/pid, ::flow/in-ports, and ::flow/out-ports.
  • Helpers like lift*->step, lift1->step, and map->step simplify step-fn creation.
  • Process launchers are created using the process function, with options like ::workload to specify execution context.
  • Flow definition includes :procs (process definitions) and :conns (connections between processes).
  • Flow lifecycle functions include start, stop, pause, resume, and ping for managing and monitoring processes.
  • The flow-monitor tool can be used for additional monitoring capabilities.