View Source cowmachine_decision_core (cowmachine v1.13.1)

HTTP decision core for cowmachine

Summary

Functions

Handle Cowmachine state request.

Cowmachine response.

Types

cmstate/0

-type cmstate() ::
          #cmstate{controller :: atom(),
                   is_process_called :: boolean(),
                   cache :: map(),
                   options :: map()}.

Functions

handle_request(CmState, Context)

-spec handle_request(CmState, Context) -> Result
                        when
                            CmState :: cmstate(),
                            Context :: cowmachine_req:context(),
                            Result ::
                                {atom(), StateResult, Context} |
                                {upgrade, UpgradeFun, StateResult, Context},
                            StateResult :: CmState,
                            UpgradeFun :: atom().

Handle Cowmachine state request.

respond(Code, State, Context)

-spec respond(Code, State, Context) -> Result
                 when
                     Code :: integer(),
                     State :: cmstate(),
                     Context :: cowmachine_req:context(),
                     Result ::
                         {term(),
                          #cmstate{controller :: atom(),
                                   is_process_called :: boolean(),
                                   cache :: map(),
                                   options :: map()},
                          term()}.

Cowmachine response.