1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253 |
- -module(cowboy_stream).
- -type streamid() :: any().
- -type fin() :: fin | nofin.
- -type headers() :: map().
- -type status_code() :: 100..999.
- -type state() :: any().
- -type commands() :: [{response, fin(), status_code(), headers()}
- | {data, fin(), iodata()}
- | {promise, binary(), binary(), binary(), binary(), headers()}
- | {flow, auto | integer()}
- | {spawn, pid()}
- | {upgrade, module(), state()}].
- -type human_reason() :: atom().
- -type reason() :: [{internal_error, timeout | {error | exit | throw, any()}, human_reason()}
- | {socket_error, closed | atom(), human_reason()}
- | {stream_error, cow_http2:error_reason(), human_reason()}
- | {connection_error, cow_http2:error_reason(), human_reason()}
- | {stop, cow_http2:frame(), human_reason()}].
- -callback init(streamid(), fin(), binary(), binary(), binary(), binary(),
- headers(), cowboy:opts()) -> {commands(), state()}.
- -callback data(streamid(), fin(), binary(), State) -> {commands(), State} when State::state().
- -callback info(streamid(), any(), state()) -> {commands(), State} when State::state().
- -callback terminate(streamid(), reason(), state()) -> any().
|