Skip to content
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

Making StreamingHandler support conditional Send #243

Open
kornelski opened this issue Nov 30, 2024 · 0 comments
Open

Making StreamingHandler support conditional Send #243

kornelski opened this issue Nov 30, 2024 · 0 comments

Comments

@kornelski
Copy link
Contributor

kornelski commented Nov 30, 2024

I've tried making StreamingHandler support Send conditionally, but it's not feasible without major rewrites. In the current architecture, the conditional Send bound becomes incredibly viral and makes a total mess of the whole internal API. The problem is that the handler is in Mutations, which makes it Mutations<H>, and the mutations are in the StartTag/EndTag structs (now StartTag<H>), which are in Token, and the Token<H> is used all over the place. The TagScanner and Lexer are tied to Token<H>, so they become Lexer<H> too. It spreads everywhere.

I think this is fixable — Mutations are not used until late in the pipeline, so the parsing stage could be changed to use another type that is something in between TokenOutline and a Token, and the types like StartTag would be (AlmostToken, Mutations<H>). However, such refactoring will touch a lot of the parser, dispatcher, token capturer. I'd prefer to release as-is to keep changes between releases small, and add non-Send support later.

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

No branches or pull requests

1 participant