cowboy_sub_protocol.asciidoc 765 B

123456789101112131415161718192021222324252627
  1. = cowboy_sub_protocol(3)
  2. == Name
  3. cowboy_sub_protocol - sub protocol
  4. == Description
  5. The `cowboy_sub_protocol` behaviour defines the interface used
  6. by modules that implement a protocol on top of HTTP.
  7. == Callbacks
  8. === upgrade(Req, Env, Handler, HandlerOpts) -> {ok, Req, Env} | {suspend, Module, Function, Args} | {stop, Req}
  9. Req = cowboy_req:req():: The Req object.
  10. Env = env():: The request environment.
  11. Handler = module():: Handler module.
  12. Opts = any():: Handler options.
  13. Module = module():: MFA to call when resuming the process.
  14. Function = atom():: MFA to call when resuming the process.
  15. Args = [any()]:: MFA to call when resuming the process.
  16. Upgrade the protocol.
  17. Please refer to the `cowboy_middleware` manual for a
  18. description of the return values.