terminate(Reason, PartialReq, State, Handler) -> ok Reason :: any() PartialReq :: map() State :: any() Handler :: module()
cowboy_handler:terminate - Terminate the handler
terminate(Reason, PartialReq, State, Handler) -> ok Reason :: any() PartialReq :: map() State :: any() Handler :: module()
Call the optional terminate callback if it is defined.
Make sure to use this function at the end of the execution of modules that implement custom handler behaviors.
Reason for termination.
The Req object.
It is possible to remove fields from the Req object to save memory when the handler has no concept of requests/responses. The only requirement is that a map is provided.
Handler state.
Handler module.
The atom ok is always returned. It can be safely ignored.
cowboy_handler:terminate(normal, Req, State, Handler).
Support my work on Cowboy, Ranch, Gun and Erlang.mk via GitHub Sponsors. The funds cover domain names and development tools.