Skip to content

Conversation

@joeshaw
Copy link
Member

@joeshaw joeshaw commented Oct 30, 2025

When fsthttp.ServeMany() is called, we now associate the options with
the context that gets passed to handlers. ServeManyOptionsFromContext()
allows handlers to retrieve those options and modify them.

A new end-to-end test demonstrates this (and allows us to test the
reusable session functionality).

One possible use case for this is for Compute applications to monitor
their heap usage, and reset ServeManyOptions.MaxRequests to 1 if it
crosses some threshold to ensure that no more requests are handled by
that session.

When fsthttp.ServeMany() is called, we now associate the options with
the context that gets passed to handlers.  ServeManyOptionsFromContext()
allows handlers to retrieve those options and modify them.

A new end-to-end test demonstrates this (and allows us to test the
reusable session functionality).

One possible use case for this is for Compute applications to monitor
their heap usage, and reset ServeManyOptions.MaxRequests to 1 if it
crosses some threshold to ensure that no more requests are handled by
that session.
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

Successfully merging this pull request may close these issues.

2 participants