Welcome! Please see the About page for a little more info on how this works.

+2 votes
in core.async by
recategorized by

Trying to capture mechanical essence of clojure.async.flow with basic terms instead of flow own terms i guess that clojure.async.flow allows to structure a system as a set of stateful functions running concurrently in the same jvm process and interacting with each other explicitly via channels.

what kind of systems could be made with clojure.async.flow?

it's definitely not naive service which handles API http requests, transforms it somehow and puts it into database.

1 Answer

0 votes
by
selected by
 
Best answer

core.async.flow is particularly well suited to what Rich called "situated programs" in the "Effective Programs" talk https://www.youtube.com/watch?v=2V1FtfBDsLU . These programs execute for long periods of time (often continuously), deal with information, have extensive "memory" (via database connections), and interact with the real world via external I/O channels (these days, often messaging systems like Kafka etc).

You're correct that flow is a poor fit to run in a lambda or in a an RPC style web request path - you are probably better served in writing synchronous code for those scenarios and avoiding the setup and async overhead. But those kinds of processes often feed one or more situated programs via a message queue or database insert.

I would also recommend Rich's "Language of the System" talk which predates flow and core.async(!) by many years but is very much of this idea. https://www.youtube.com/watch?v=ROor6_NGIWU

...