streambox_core library

Classes

BaseCacheStrategy<P extends RequestParams, R>
A base implementation of a cache strategy that integrates a Cache with a request/response stream mechanism.
BaseDataSource<P extends RequestParams, R>
Base implementation of the DataSource interface that integrates with a CacheStrategy to manage fetching, caching, and streaming of request states.
BaseExternalStreamDataSource<P extends RequestParams, R>
A base implementation of DataSource that integrates with an external Stream of values instead of performing direct requests.
BaseKeyValueCache<R>
Base implementation of a key-value cache that uses a KeyValueStoreInterface for persistence.
BaseRepo<P extends RequestParams, E>
A base implementation of the Repo interface.
Cache<R>
A generic cache interface for storing and retrieving values by key.
CacheFirstStrategy<P extends RequestParams, R>
A cache strategy that always attempts to serve data from cache first.
CacheStrategy<P extends RequestParams, R>
Defines a strategy for handling requests with caching support.
CacheThenRefreshStrategy<P extends RequestParams, R>
A cache strategy that delivers cached data immediately (if available), then refreshes it with a newly fetched value.
ChainedSourcesRepo<P1 extends RequestParams, P2 extends RequestParams, R1, R2, E>
A repository implementation that chains two DataSources, where the second source depends on the result of the first.
DataError<E>
Indicates that an error occurred while loading data.
DataInitial<E>
Indicates that the repository's data has been explicitly cleared via a flush operation, and no data is currently available.
DataLoading<E>
Indicates that data is currently being loaded.
DataSource<P extends RequestParams, R>
A generic data source interface for executing requests, managing lifecycle, and exposing request states.
DataState<E>
Represents the state of data in a repository or request flow.
DataSuccess<E>
Indicates that data has been successfully loaded.
KeyValueStoreInterface
A simple interface for key-value storage systems.
NoOpCacheStrategy<P extends RequestParams, R>
A no-op cache strategy that performs no caching at all.
PeriodicRepo<P extends RequestParams, R, E>
A repository implementation that periodically fetches data from a DataSource at a fixed interval.
Repo<P extends RequestParams, E>
A generic repository interface for managing data fetching, state streaming, and lifecycle control.
RequestError<P extends RequestParams, R>
Indicates that a request has failed.
RequestInitial<P extends RequestParams, R>
Indicates the initial state before any request has been made.
RequestLoading<P extends RequestParams, R>
Indicates that a request is currently in progress.
RequestParams
Base interface for defining request parameters.
RequestPayload<P extends RequestParams, R>
Represents the base class for all request states.
RequestSuccess<P extends RequestParams, R>
Indicates that a request has successfully completed.
RequestVersion
A simple counter used to track request versions.
SingleSourceRepo<P extends RequestParams, R, E>
A repository implementation that consumes a single DataSource and exposes mapped entities of type E.
StreamBoxErrorObserver
Interface for observing errors emitted by repositories.
StreamBoxErrorObservers
Singleton manager for global error observers.

Constants

kDefaultCacheKey → const String
The default cache key used when RequestParams.cacheKey is not provided.

Typedefs

ValueFetcher<R> = Future<R> Function()
A function type that defines an asynchronous value fetcher.