Skip to content

Conversation

@andersio
Copy link
Member

@andersio andersio commented Dec 22, 2017

So that it abides to the interruption on specified scheduler rule exhibited by its peer async operators.

Checklist

  • Updated CHANGELOG.md.

@NachoSoto
Copy link
Member

Does this fix a bug? If so it might be worth adding a test. Otherwise doesn't seem worth rewriting the operator from scratch…

@andersio
Copy link
Member Author

andersio commented Dec 22, 2017

@NachoSoto Done in c8e3a8c.

The majority of async operators forward all events to the specified scheduler, and the downstream initiated interrupted event has been respecting the specified closest scheduler in the path* since 2.0. So the lazyMap here is aligned to them for consistency.

* Edit: So that one won't get a surprise of interrupted not being delivered on the designated scheduler, in the case of an observer accessing queue confined resources. e.g.

let disposable = producer
    .observe(on: scheduler)
    .start(observerAccessingResourcesConfinedToTheSchedulerAbove)

DispatchQueue.global(qos: .userInitiative).asyncAfter(wallTime: .now() + .seconds(10)) {
    disposable.disposed() // In 1.0 & earlier, this would cause an immediate
                 // `interrupted` event on this global concurrent queue.
}

@andersio andersio merged commit ed78a0a into master Dec 22, 2017
@andersio andersio deleted the lazy-map branch December 22, 2017 18:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants