cats effect

Fibers: The Fundamental Abstraction in Cats Effect 3

Reading Time: 2 minutes Fibers are the fundamental abstraction in Cats Effect, similar to threads, they represent a sequence of actions which will ultimately be evaluated in that order by the underlying hardware. Fibers are very lightweight. Since fibers diverge from threads is in their footprint and level of abstraction. In thread each step is a statement, and defined in sequence by writing them in particular order within a Continue Reading

Cats Effect : Pure Functional way to code in Scala

Reading Time: 2 minutes Follow 5 Simple Rules with Cats Program written using Cats Effect provides incredibly strong guarantees and powerful functionality, performance, safety, and composability, provided you follow each of the following rules: Wrap all side-effects in delay, async, blocking, or interruptible (pro tip: try to keep the size of your delay blocks small; two delays with a flatMap is much better than one big delay) Use bracket or Resource for anything which must be closed Never hard-block a thread outside of blocking or interruptible Use IOApp instead of writing your own def main Continue Reading