Skip to content

bmironenko/weather-fs2

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

weather-fs2

This is a very basic technology demo for libraries in the Typelevel ecosystem, primarily fs2 and doobie. It uses the cats-effect runtime.

The utility uses the OpenWeatherMap API to stream weather data for configured locations, perform some transformations, and record it in a Postgres database.

There is also a much more developed ZIO-based version of this demo.

Usage

Database

By default, a postgres database is needed to run the demo. The schema can be found here.

Alternatively, to simply log data to console, one could comment out the database stage of the stream in Main.run():

// .flatMap { chunk =>
//   // write each batch as a single operation
//   // this can also be done as a pipe along with the grouping
//   Stream.eval(writeSamples(chunk.toList*))
// }

Configuration

There is currently no configuration file. See Main.scala to set owmApiKey constant and to configure the database Transactor.

Run

You can compile code with sbt compile, run it with sbt run.

About

Typelevel ecosystem demo

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages