Skip to content

offer Structured Concurrency API that supports HTTP response streaming #807

Open
@weissi

Description

@weissi

Currently, most of HTTPClient's API surface only supports Structured Concurrency violating functions. Baby steps to rectify this have been done in #806. But the elephant in the room is of course the unstructured HTTP request API.

We need to also provide a

try await httpClient.execute(request) { status, responseBodyStream in
   ...
}

API that fulfils Structured Concurrency by supporting cancellation and tearing everything down when the body function returns or throws without ineffective and ugly hacks like deinit (which still violates Structured Concurrency because it doesn't follow the structure of the code).

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