Provider
A Provider is a thread-safe, lazily-evaluated, reactive data source that holds a single value of type T.
Using map, flatMap, and various extension functions, atomic data transformations can be modelled.
Additionally, it is also possible to subscribe to and observe providers. Note that subscribing disables the lazy evaluation of the provider, as the value will need to be calculated immediately when an update happens in order to propagate it to the subscribers.
It is important that all data transformation functions are pure, meaning that they are side effect free and do not access any mutable external state, in order to maintain the integrity of lazy evaluation. It is especially important that they do not resolve any other provider's value, as doing so may risk deadlocks. To properly operate on the values of multiple providers, combine them first via combinedProvider.
Inheritors
Functions
Creates and returns a new Provider that flat-maps the elements of the Collection obtained from this into a collection created by makeCollection using the transform function.
Creates and returns a new MutableProvider that maps to the value of the MutableProvider returned by transform.
Creates and returns new MutableProvider that lazily maps to the value of the MutableProvider returned by transform.
Creates and returns a new Provider that maps each element of the Collection obtained from this using the transform function and filters out all null results. The results are added to a collection created by makeCollection.
Creates and returns a new Provider that maps each element of the Collection obtained from this using the transform function and adds the results to a collection created by makeCollection.
Creates and returns a new Provider that throws an IllegalArgumentException with a message generated by message if the value is null
.
Creates and returns a new Provider that throws an IllegalArgumentException with message if the value is null
.
Creates and returns a new Provider that flat-maps the elements of the Collection obtained from this into a collection created by makeCollection using the transform function.
Creates and returns a new MutableProvider that maps to the value of the MutableProvider returned by transform.
Creates and returns new MutableProvider that lazily maps to the value of the MutableProvider returned by transform.
Creates and returns a new Provider that maps each element of the Collection obtained from this using the transform function.
Creates and returns a new Provider that maps each element of the Collection obtained from this using the transform function and filters out all null results. The results are added to a collection created by makeCollection.
Creates and returns a new Provider that maps each element of the Collection obtained from this using the transform function and adds the results to a collection created by makeCollection.
Creates and returns a new Provider that throws an IllegalArgumentException with a message generated by message if the value is null
.
Creates and returns a new Provider that throws an IllegalArgumentException with message if the value is null
.
Removes all weak observers under the given owner.
Removes a previously registered weak observer.
Removes a previously registered subscriber.
Removes all weak subscribers under the given owner.
Removes a previously registered weak subscriber.