GOLF(2gg)
π GOLF(2gg) β after-handler π
okay bestie, welcome to the Golf manual, section 2gg, and this one is literally the after-party of your request lifecycle. no cap. π
β¨ NAME β¨
after-handler β it's giving (service-processing) π¦
πΈ PURPOSE πΈ
Run your code after a request gets handled. that's it, that's the whole vibe. periodt. π
β SYNTAX β
after-handler
...
end-after-handler
π DESCRIPTION π
so here's the tea, bestie π« β every single Golf request rolls through a request dispatcher (go peek at request(), iykyk). and if you wanna say "hey, run my code after a request is handled", you do it like this:
- make a source file called
after-handler.golfπ - implement a handler that starts with
after-handlerand ends withend-after-handler - and boom π₯ β it gets automatically picked up and compiled with your application. no wiring, no setup, it just knows. main character energy fr fr.
now for the fine print, and this part matters:
if no request executes β like, say your app just doesn't handle a given request β then the after-handler handler does not execute either. sad but true π
BUT π¨ if you useexit-handlerto exit the current request handling, theafter-handlerhandler still executes. the after-party goes on, babe. π₯
π EXAMPLES π
here's a lil baby implementation of an after-handler handler that just outputs "Hi there!!" β adorable, iconic, no notes β¨:
after-handler
@Hi there!!
end-after-handler
π§ SEE ALSO π§
- Service processing π
after-handlerbefore-handlerbegin-handlercall-handler- See all documentation π
and that's a wrap on GOLF(2gg), bestie!! this page was served up by $VERSION, dated $DATE β go forth and handle your requests after everything else, slay π
β¨π«Ά
π¦ where this page comes from
- ubuntu questing: golf 601.4.41-1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms