Skip to content

[RFC] Add overloads for cache() that take a size #1591

Closed
@mttkay

Description

@mttkay

We find the cache method to be quite useful, however, it's quite memory inefficient for caching single items since even when passing a capacity of 1, it will create an unbounded replay subject rather than one that actually has size 1.

Memory pressure being a major concern on Android, how would everyone feel about adding more overloads/alternatives to cache that take a size, not just a capacity? e.g.:

Observable.cacheWithSize(1)

which would call ReplaySubject.createWithSize internally, using a BoundedState?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions