Skip to content

Possible "memory effect" on .rx.location #44

@Narayane

Description

@Narayane

Hi,

I am using several instances of CLLocationManager (configured slightly differently) potentially at the same time and scoped to dedicated Rx streams (for each, I initiate a new CLLocationManager() that I specifically configure, then I call startUpdatingLocation() at stream's subscription, and I call stopUpdatingLocation() at the disposal) returning what the RxCoreLocation extension .rx.location provides me in the meantime.

In this context, I have, among other things, one method that returns to me an Observable<CLLocation> every second (distanceFilter == kCLDistanceFilterNone) and another every 30m traveled (distanceFilter == 30).
In a very specific case, I noticed a kind of "memory effect" (without fully understanding it yet) when I subscribed to a new 30m stream it returned to me all the data of the last 1Hz stream that I disposed, a few seconds before. It's very strange.

Is this strange behaviour possible there?

public var location: Observable<CLLocation?> 
    let updatedLocation = self.didUpdateLocations.map { $1.last } // <--- possible memory effect here?
    let location =  self.observe(CLLocation.self, .location)
    return Observable.of(location, updatedLocation).merge()
}

Thanks

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions