Skip to content

docs(server): developing generated server handlers with Revise - #133

Merged
krynju merged 1 commit into
mainfrom
tan/revise-server-docs
Oct 2, 2026
Merged

krynju merged 1 commit into
mainfrom
tan/revise-server-docs

Conversation

@tanmaykm

@tanmaykm tanmaykm commented Oct 1, 2026

Copy link
Copy Markdown
Member

Closes #118.

HTTP.jl 2.x no longer calls handlers through Base.invokelatest. A running generated server therefore keeps the method world it started in, and doesn't see handler edits made with Revise.

  • A new section, "Developing handlers with Revise", in docs/src/servers.md, with a pointer from the README. It shows how to wrap handlers with Base.invokelatest through register!'s middleware keyword. It also explains why this isn't the default: invokelatest cannot be compiled with --trim.
  • A test in test/servergen.jl checks that a handler redefined while the server is running is picked up without a restart.

Full suites pass on Julia 1.12 and 1.10. The reviewer reproduced the stale-handler behaviour outside the test: without the middleware, the server returns the old result; with it, the new one.

Possible follow-up (minor review note)

Add a negative control to the test: a server started without the middleware should keep returning the old result. That would pin down the premise the docs describe.

…t middleware

HTTP.jl 2.x no longer calls handlers through Base.invokelatest, so a running
generated server keeps the method world it started in and does not see
handler edits made with Revise. Document wrapping handlers with
Base.invokelatest through register!'s middleware keyword, why it is not the
default (it cannot be compiled with --trim), and add a test that a redefined
handler is picked up without restarting the server.

Closes #118
@tanmaykm
tanmaykm marked this pull request as ready for review October 1, 2026 06:04
@tanmaykm
tanmaykm requested review from krynju and nkottary October 1, 2026 06:53
@krynju
krynju merged commit f706701 into main Oct 2, 2026
5 checks passed
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.

How to make openapi server implementation revisable?

2 participants