~zainab/blog

fb0935c51d3e9ba77146149ce86823c5a6c69090 — zainab-ali 4 months ago 26a1999
Rename `factorials` to `tenFactorials`
M src/chapters/2022-02-12-cats-effect-ioruntime/snippets.md => src/chapters/2022-02-12-cats-effect-ioruntime/snippets.md +5 -5
@@ 123,13 123,13 @@ time(factorial).unsafeRunSync()(basicRuntime)
# factorial-io-parallelized

```scala mdoc:silent
val factorials: IO[Unit] = List.fill(10)(factorial).parSequence.void
val tenFactorials: IO[Unit] = List.fill(10)(factorial).parSequence.void
```

# factorial-io-parallelized-run

```scala mdoc
time(factorials).unsafeRunSync()(basicRuntime)
time(tenFactorials).unsafeRunSync()(basicRuntime)
```

# runtime-available-processors


@@ 156,7 156,7 @@ timedFactorials.unsafeRunSync()(basicRuntime)
# factorial-bounded-threadpool

```scala mdoc
time(factorials).unsafeRunSync()(boundedRuntime(2))
time(tenFactorials).unsafeRunSync()(boundedRuntime(2))
```

# factorial-time-bounded-threadpool


@@ 194,7 194,7 @@ time(tenSnoozes).unsafeRunSync()(boundedRuntime(numProcessors))

```scala mdoc:silent
val snoozeAndCompute: IO[Unit] = 
  List(factorials, tenSnoozes).parSequence.void
  List(tenFactorials, tenSnoozes).parSequence.void
```

# combined-run


@@ 237,7 237,7 @@ time(tenBetterSnoozes).unsafeRunSync()(boundedRuntime(numProcessors))

```scala mdoc:silent
val betterSnoozeAndCompute: IO[Unit] =
  List(factorials, tenBetterSnoozes).parSequence.void
  List(tenFactorials, tenBetterSnoozes).parSequence.void
```



M src/chapters/2022-02-12-cats-effect-ioruntime/snippets.out.md => src/chapters/2022-02-12-cats-effect-ioruntime/snippets.out.md +5 -5
@@ 140,13 140,13 @@ time(factorial).unsafeRunSync()(basicRuntime)
# factorial-io-parallelized

```scala
val factorials: IO[Unit] = List.fill(10)(factorial).parSequence.void
val tenFactorials: IO[Unit] = List.fill(10)(factorial).parSequence.void
```

# factorial-io-parallelized-run

```scala
time(factorials).unsafeRunSync()(basicRuntime)
time(tenFactorials).unsafeRunSync()(basicRuntime)
// res5: String = "The task took 3 seconds."
```



@@ 197,7 197,7 @@ timedFactorials.unsafeRunSync()(basicRuntime)
# factorial-bounded-threadpool

```scala
time(factorials).unsafeRunSync()(boundedRuntime(2))
time(tenFactorials).unsafeRunSync()(boundedRuntime(2))
// res7: String = "The task took 12 seconds."
```



@@ 303,7 303,7 @@ time(tenSnoozes).unsafeRunSync()(boundedRuntime(numProcessors))

```scala
val snoozeAndCompute: IO[Unit] = 
  List(factorials, tenSnoozes).parSequence.void
  List(tenFactorials, tenSnoozes).parSequence.void
```

# combined-run


@@ 349,7 349,7 @@ time(tenBetterSnoozes).unsafeRunSync()(boundedRuntime(numProcessors))

```scala
val betterSnoozeAndCompute: IO[Unit] =
  List(factorials, tenBetterSnoozes).parSequence.void
  List(tenFactorials, tenBetterSnoozes).parSequence.void
```