[FS2] - Mutability of Queue in Stream

This page summarizes the projects mentioned and recommended in the original post on /r/scala

Our great sponsors
  • InfluxDB - Power Real-Time Data Analytics at Scale
  • WorkOS - The modern identity platform for B2B SaaS
  • SaaSHub - Software Alternatives and Reviews
  • FS2

    Compositional, streaming I/O library for Scala

  • Lets decompose this code from the article a little. The definition of circularBuffer indicates that given a buffer size the function will return G[Queue[F, A]]. https://github.com/typelevel/fs2/blob/19bb74cac3c9b51bc5419b70fed224d24e0e1c2e/core/shared/src/main/scala/fs2/concurrent/Queue.scala#L173-L174 G is some higher kinded type with an implementation of the Sync typeclass (https://github.com/typelevel/fs2/blob/19bb74cac3c9b51bc5419b70fed224d24e0e1c2e/core/shared/src/main/scala/fs2/concurrent/Queue.scala#L152) (a typeclass for suspending synchronous actions). Why is G needed? Well Queue's are asynchronous data structures so some concurrency primitives must be allocated like Ref and Deferred. (https://typelevel.org/cats-effect/docs/std/ref).

  • InfluxDB

    Power Real-Time Data Analytics at Scale. Get real-time insights from all types of time series data with InfluxDB. Ingest, query, and analyze billions of data points in real-time with unbounded cardinality.

    InfluxDB logo
NOTE: The number of mentions on this list indicates mentions on common posts plus user suggested alternatives. Hence, a higher number means a more popular project.

Suggest a related project

Related posts