initial commit
I have an implementation of reliable messages in another repo, but I want to start over with a focus on streams.
This commit is contained in:
commit
e9efcccfd0
3
.gitignore
vendored
Normal file
3
.gitignore
vendored
Normal file
@ -0,0 +1,3 @@
|
||||
*.beam
|
||||
*.swp
|
||||
erl_crash.dump
|
||||
1
Emakefile
Normal file
1
Emakefile
Normal file
@ -0,0 +1 @@
|
||||
{"src/*", [debug_info, {i, "include/"}, {outdir, "ebin/"}]}.
|
||||
19
LICENSE
Normal file
19
LICENSE
Normal file
@ -0,0 +1,19 @@
|
||||
Copyright 2025 Jarvis Carroll <spiveehere@gmail.com>
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
14
ebin/msp.app
Normal file
14
ebin/msp.app
Normal file
@ -0,0 +1,14 @@
|
||||
{application,msp,
|
||||
[{description,"Reliable transport over UDP"},
|
||||
{registered,[]},
|
||||
{included_applications,[]},
|
||||
{applications,[stdlib,kernel]},
|
||||
{vsn,"0.1.0"},
|
||||
{modules,[zx,zx_auth,zx_conn,zx_conn_sup,zx_daemon,zx_key,
|
||||
zx_lib,zx_local,zx_net,zx_peer,zx_peer_man,
|
||||
zx_peer_sup,zx_peers,zx_proxy,zx_sup,zx_tty,
|
||||
zx_userconf,zx_zsp,funfile,appmod,'_state','_sup',
|
||||
'_top',appmod,'_client','_client_man','_client_sup',
|
||||
'_clients','_sup',appmod,'_con','_gui','_sup',
|
||||
simplecli,worker,worker_man,worker_sup,workers]},
|
||||
{mod,{msp,[]}}]}.
|
||||
16
src/msp.erl
Normal file
16
src/msp.erl
Normal file
@ -0,0 +1,16 @@
|
||||
-module(msp).
|
||||
-behavior(application).
|
||||
|
||||
-export([start/0, stop/0]).
|
||||
-export([start/2, stop/1]).
|
||||
|
||||
start() -> application:start(hakuzaru).
|
||||
|
||||
stop() -> application:stop(hakuzaru).
|
||||
|
||||
start(normal, _Args) ->
|
||||
msp_sup:start_link().
|
||||
|
||||
stop(_State) ->
|
||||
ok.
|
||||
|
||||
32
src/msp_man.erl
Normal file
32
src/msp_man.erl
Normal file
@ -0,0 +1,32 @@
|
||||
-module(msp_man).
|
||||
-behaviour(gen_server).
|
||||
|
||||
-export([start_link/0]).
|
||||
-export([init/1, handle_call/3, handle_cast/2, handle_info/2]).
|
||||
|
||||
-record(s,
|
||||
{}).
|
||||
|
||||
-type state() :: #s{}.
|
||||
|
||||
start_link() ->
|
||||
gen_server:start_link({local, ?MODULE}, ?MODULE, none, []).
|
||||
|
||||
-spec init(none) -> {ok, state()}.
|
||||
|
||||
init(none) ->
|
||||
ok = io:format("msp_man starting.~n", []),
|
||||
State = #s{},
|
||||
{ok, State}.
|
||||
|
||||
handle_call(_, _, State) ->
|
||||
{reply, ok, State}.
|
||||
|
||||
handle_cast(_, State) ->
|
||||
{noreply, State}.
|
||||
|
||||
handle_info(Unexpected, State) ->
|
||||
ok = io:format("Warning: Unexpected info ~p~n", [Unexpected]),
|
||||
{noreply, State}.
|
||||
|
||||
|
||||
18
src/msp_sup.erl
Normal file
18
src/msp_sup.erl
Normal file
@ -0,0 +1,18 @@
|
||||
-module(msp_sup).
|
||||
-behaviour(supervisor).
|
||||
|
||||
-export([start_link/0]).
|
||||
-export([init/1]).
|
||||
|
||||
start_link() ->
|
||||
supervisor:start_link({local, ?MODULE}, ?MODULE, []).
|
||||
|
||||
init([]) ->
|
||||
RestartStrategy = {one_for_one, 0, 60},
|
||||
Children = [{msp_man,
|
||||
{msp_man, start_link, []},
|
||||
permanent,
|
||||
5000,
|
||||
worker,
|
||||
[msp_man]}],
|
||||
{ok, {RestartStrategy, Children}}.
|
||||
17
zomp.meta
Normal file
17
zomp.meta
Normal file
@ -0,0 +1,17 @@
|
||||
{name,"Minimal Stream Protocol"}.
|
||||
{type,app}.
|
||||
{modules,[]}.
|
||||
{prefix,"msp"}.
|
||||
{author,"Jarvis Carroll"}.
|
||||
{desc,"Reliable transport over UDP"}.
|
||||
{package_id,{"otpr","msp",{0,1,0}}}.
|
||||
{deps,[]}.
|
||||
{key_name,none}.
|
||||
{a_email,"spiveehere@gmail.com"}.
|
||||
{c_email,"spiveehere@gmail.com"}.
|
||||
{copyright,"Jarvis Carroll"}.
|
||||
{file_exts,[]}.
|
||||
{license,"MIT"}.
|
||||
{repo_url,"https://git.qpq.swiss/spivee/msp"}.
|
||||
{tags,[]}.
|
||||
{ws_url,[]}.
|
||||
Loading…
x
Reference in New Issue
Block a user