barrel_p2p_streams (barrel_p2p v0.1.0)
View SourceSummary
Functions
List currently registered tags and their handlers.
Open a tagged stream to Node. The calling process becomes the stream owner; quic_dist:send/2,3, quic_dist:close_stream/1, and the native {quic_dist_stream, _, _} events all apply.
Register Pid as the handler for incoming streams tagged Tag. After registration the handler receives: {mstream, StreamRef, opened, FromNode} followed by the native quic_dist events: {quic_dist_stream, StreamRef, {data, Data, Fin}} {quic_dist_stream, StreamRef, closed} {quic_dist_stream, StreamRef, {stream_reset, Code}} The handler can use quic_dist:send/2,3 and quic_dist:close_stream/1 on StreamRef.
Remove the handler registered for Tag.
Functions
List currently registered tags and their handlers.
-spec open(binary(), node()) -> {ok, quic_dist:stream_ref()} | {error, term()}.
Open a tagged stream to Node. The calling process becomes the stream owner; quic_dist:send/2,3, quic_dist:close_stream/1, and the native {quic_dist_stream, _, _} events all apply.
The tag preamble is written before this call returns so the peer's barrel_p2p_streams demuxer can dispatch the stream as soon as the first chunk arrives.
Register Pid as the handler for incoming streams tagged Tag. After registration the handler receives: {mstream, StreamRef, opened, FromNode} followed by the native quic_dist events: {quic_dist_stream, StreamRef, {data, Data, Fin}} {quic_dist_stream, StreamRef, closed} {quic_dist_stream, StreamRef, {stream_reset, Code}} The handler can use quic_dist:send/2,3 and quic_dist:close_stream/1 on StreamRef.
-spec unregister_acceptor(binary()) -> ok.
Remove the handler registered for Tag.