Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/fancellu/fs2-examples
A few fs2 examples (streaming file io, moving average, queue example, echo server, REPL)
https://github.com/fancellu/fs2-examples
cats cats-effect fs2 scala
Last synced: 23 days ago
JSON representation
A few fs2 examples (streaming file io, moving average, queue example, echo server, REPL)
- Host: GitHub
- URL: https://github.com/fancellu/fs2-examples
- Owner: fancellu
- Created: 2024-08-09T15:48:30.000Z (3 months ago)
- Default Branch: main
- Last Pushed: 2024-08-18T13:16:48.000Z (3 months ago)
- Last Synced: 2024-10-01T15:59:15.821Z (about 1 month ago)
- Topics: cats, cats-effect, fs2, scala
- Language: Scala
- Homepage:
- Size: 9.77 KB
- Stars: 5
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# FS2 examples (And ZIO too!)
A few fs2/zio examples
## Converter1 (Also a ZIO version)
Converts from Fahrenheit file to stdout in Celsius
- Parses multiple input files
- Handles empty lines, comments, non doubles, missing files
- Formats to 2 decimal places
- Prepends with a header line## WindowedAverage (Also a ZIO version)
- Emits a windowed running average of the last 5 values
## QueueExample (Also a ZIO version)
- Creates stream that emits incrementing int every 100ms to a queue
- Creates stream that reads int from queue and adds int to ref
- Runs both at the same time, terminating after 1 second, printing out the ref sum## EchoServer
- Listens for telnet to port 5555, 2 concurrent connections
- Echos commands back to user
- "EXIT" will say "Byebye!" and terminate their connection
- "KILLSERVER" will terminate the server
- Also spins up a REPL, so we can kill server cleanly from console, via SignallingRef## REPL (Also a ZIO version)
- A simple REPL example
- Echos in the input from stdin
- Exits loop upon "KILLSERVER" or EOF signal