SignallingMapRef

fs2.concurrent.SignallingMapRef$
See theSignallingMapRef companion trait

Attributes

Companion
trait
Source
Signal.scala
Graph
Supertypes
class Object
trait Matchable
class Any
Self type

Members list

Value members

Concrete methods

def ofSingleImmutableMap[F[_], K, V](initial: Map[K, V])(implicit F: Concurrent[F]): F[SignallingMapRef[F, K, Option[V]]]

Builds a SignallingMapRef for effect F, initialized to the supplied value.

Builds a SignallingMapRef for effect F, initialized to the supplied value.

Update semantics for discrete are the same as SignallingRef, with one exception: it cannot distinguish updates that remove a key (by setting its value to None).

More specifically: if you remove a key, this will only notify once per listener i.e. setting it to None again will not trigger another update. Furthermore, if a listener's last pull returned None, and by the time it pulls again the current value is None, then it will not be notified regardless of any non-None updates that may have happened between the pulls. This special semantic for None is necessary to prevent memory leaks at keys with no values and no listeners.

Attributes

Source
Signal.scala