Functional streams for factorians
summary
Implements a mini Factorio factory using FS2 (Functional Streams for Scala) and a bounded Queue via Cats Effect, composing drill -> belt -> furnace -> assembler streams. Shows concrete tuning: prefetchN = 50 input buffers, chunkN(3) to batch three cables, two furnaces per miner because smelting takes ~2× mining time, first electronic circuit appears around 8s. Demonstrates merge, parZip, evalMap, concurrent background streams, and a real deadlock case when downstream .take(2) starves a queue — code runs but needs careful buffer management.
AI-written summary · about
chapters (8)
- 0:00Introduction and me
- 2:53Back pressure in Factorio
- 3:14Simple mining drill demo
- 6:01Smelting iron ore
- 9:56Transfer belt with queues
- 14:06Assembly machines
- 19:43Splitters and filtering
- 24:54Conclusion and resources
related talks
16mFS2 - CRASH COURSE
42mLearn you Akka Streams for great Good!
46mStreams, effects and beautiful folds, a winning trilogy
51mScalaz Streams A Functional Approach to Compositional...
44mThe Pierian Stream
44mScalaz Stream: Rebirth
49mA Practical Introduction to Akka Streams
01h 07mA Practical Introduction to Akka Streams
