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

Typed Headers #33

Open
nielsenko opened this issue Mar 12, 2025 · 0 comments
Open

Typed Headers #33

nielsenko opened this issue Mar 12, 2025 · 0 comments
Assignees

Comments

@nielsenko
Copy link
Collaborator

The current implementation of typed headers presents several challenges that need addressing:

  • Flexibility & customization
    Developers should be able to define their own typed header classes, customize parsing behavior, and extend functionality as needed without modifying the core library. It should be possible to mix-and-match strict vs non-strict parsing modes on a per-header, per-handler basis.

  • Opt-in approach
    Forcing typed headers on all users create unnecessary complexity for some use cases. A gradual adoption approach allows developers to migrate at their own pace, maintaining backward compatibility with existing code while providing a clear path forward.

  • Efficiency & performance
    Header parsing and serialization should have minimal overhead compared to raw string operations. This means avoiding unnecessary object allocations, optimizing parsing algorithms, and ensuring that typed headers don't become a bottleneck in request processing.

    The current implementation pays for typed headers up front in terms of memory usage. Some effort has gone into supporting lazy parsing, but some operations still force eager parsing.

  • Custom header support
    Beyond standard HTTP headers, applications often define custom headers for specific functionality. The typed header system should provide an extensible framework that allows developers to easily define and use their own custom header types with the same benefits as built-in headers.

  • Inter-isolate sharing
    Since Dart applications often use multiple isolates for concurrency, header objects should be easily transferable between isolates without expensive serialization/deserialization cycles. This requires careful consideration of the internal representation of header data.

@nielsenko nielsenko self-assigned this Mar 13, 2025
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