3 ms·
Flow-based programming instantiates numerous processes that are inherently stateful: they sit in a loop performing I/O operations: they read packets from input
by kazinator 7y ago
Flow-based programming instantiates numerous processes that are inherently stateful: they sit in a loop performing I/O operations: they read packets from input ports, transform them, and put them into output ports. The system as a whole has state: which packets are now being processed where. The ports represent stateful queues which buffer the packets. There is a pure functional view in that a pipeline of processes looks like a functional transformation. Just like we can regard "find . | grep | sort" as functional, ignoring all the grotty procedural C with I/O, buffering and all sorts of mutation.
In Morrison's Flow-Based Programming book (which I happen to have in some storage cabinet somewhere) there are explicitly stateful examples, such as nodes which treat information packets (IP's) as syntactic tokens, doing parenthesis matching and such.