Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
weissi opened this issue Apr 5, 2020 · 0 comments · Fixed by #215
Closed

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

weissi opened this issue Apr 5, 2020 · 0 comments · Fixed by #215
Assignees
Labels
kind/bug Feature doesn't work as expected.
Milestone

Comments

@weissi
Copy link
Contributor

weissi commented Apr 5, 2020

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Feature doesn't work as expected.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants