Skip to content

programming model: EventLoopPreference.delegate(on:) not respected for .stream #198

Closed
@weissi

Description

@weissi

I'm not 100% sure if this counts as a bug but I think it should because it makes the programming model really hard.

If I configure

                let desiredEL = context.eventLoop // or some other EL I like
                let req = try HTTPClient.Request(url: url, method: req.method, headers: req.headers, body: .stream { _ in desiredEL.preconditionInEventLoop() })
                let task = self.httpClient.execute(request: req,
                                                   delegate: self,
                                                   eventLoop: .delegate(on: desiredEL))

this would fail as the closure passed to .stream isn't executed on desiredEL.

Metadata

Metadata

Assignees

Labels

kind/bugFeature doesn't work as expected.

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions