Skip to content

Remove Deferred.asWorker() converter function #10

@zach-klippenstein

Description

@zach-klippenstein

This converter looks a lot like Single.asWorker(), but has a major pitfall: it doesn't scope. This difference is subtle, and might make code hard to reason about: given foo.asWorker(), the work will be scoped to the Worker if foo is a cold future like Single, but not if it's a hot future like Deferred.

A more theoretical reason is that I think it's bad coroutines practice to expose Deferreds as public API because it breaks structured concurrency. We shouldn't encourage that practice by providing this converter.

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