Skip to content

keirlawson/fs2-progress

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

fs2-progress

demo

A command line progress bar that you can feed your streams to. Published for Scala 2.13 and 3.1.

Wraps Progressbar.

You can find the scaladoc for the latest version here.

Installation

Add the following to your SBT library dependencies:

"io.github.keirlawson" %% "fs2-progress" % "1.0.0"

Usage

An example that tracks the progress in emitting the letters of the alphabet:

import fs2.Stream
import fs2.progress.ProgressBar
import scala.concurrent.duration._
import cats.effect.IO

val elements = 'A' to 'Z'
val letters = Stream.emits[IO, Char](elements).metered(500.millis) //emit one letter every 500 millis

ProgressBar.stream[IO]("Letters progress", elements.length).flatMap { progress =>
    letters.through(progress.pipe)
}

About

A command line progress bar for fs2 streams

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages