quicer_stream behaviour (quicer v0.4.3)
View SourceSummary
Functions
Starts the server
Start a new stream owner process and then handoff ownership to this process --------------------------------------------------------------------
Types
-type cb_ret() :: quicer_lib:cb_ret().
-type cb_state() :: term().
-type conf_handle() :: reference().
-type connection_handle() :: reference().
-type global_handle() :: quic_global.
-type handle() :: global_handle() | listener_handle() | connection_handle() | stream_handle() | conf_handle() | reg_handle().
-type listener_handle() :: reference().
-type new_stream_props() :: #{is_orphan := boolean(), flags := stream_open_flags()}.
-type reg_handle() :: reference().
-type state() :: #{stream := quicer:stream_handle(), conn := quicer:connection_handle(), callback := atom(), callback_state := term(), is_owner := boolean(), stream_opts := map()}.
-type stream_handle() :: reference().
-type stream_open_flags() :: 0 | 1 | 2.
Callbacks
-callback handle_call(Req :: term(), gen_server:from(), cb_state()) -> cb_ret().
-callback handle_stream_data(stream_handle(), binary(), recv_data_props(), cb_state()) -> cb_ret().
-callback init_handoff(stream_handle(), stream_opts(), connection_handle(), new_stream_props()) -> cb_ret().
-callback new_stream(stream_handle(), new_stream_props(), connection_handle()) -> cb_ret().
-callback passive(stream_handle(), undefined, cb_state()) -> cb_ret().
-callback peer_accepted(connection_handle(), stream_handle(), cb_state()) -> cb_ret().
-callback peer_receive_aborted(stream_handle(), error_code(), cb_state()) -> cb_ret().
-callback peer_send_aborted(stream_handle(), error_code(), cb_state()) -> cb_ret().
-callback peer_send_shutdown(stream_handle(), undefined, cb_state()) -> cb_ret().
-callback post_handoff(stream_handle(), PostInfo :: term(), cb_state()) -> cb_ret().
-callback send_complete(stream_handle(), IsCanceled :: boolean(), cb_state()) -> cb_ret().
-callback send_shutdown_complete(stream_handle(), IsGraceful :: boolean(), cb_state()) -> cb_ret().
-callback start_completed(stream_handle(), stream_start_completed_props(), cb_state()) -> cb_ret().
-callback stream_closed(stream_handle(), stream_closed_props(), cb_state()) -> cb_ret().
Functions
-spec send(pid(), binary()) -> {ok, Length :: non_neg_integer()} | {error, any()}.
-spec start_link(Callback :: module(), Conn :: quicer:connection_handle(), StreamOpts :: map()) -> {ok, Pid :: pid()} | {error, Error :: {already_started, pid()}} | {error, Error :: term()} | ignore.
Starts the server
-spec start_link(Callback :: module(), Stream :: quicer:stream_handle(), Conn :: quicer:connection_handle(), StreamOpts :: map(), Props :: new_stream_props()) -> {ok, Pid :: pid()} | {error, Error :: {already_started, pid()}} | {error, Error :: term()} | ignore.
Start a new stream owner process and then handoff ownership to this process --------------------------------------------------------------------