diff --git a/NOTES.txt b/NOTES.txt index f1e6a85..9c8f372 100644 --- a/NOTES.txt +++ b/NOTES.txt @@ -1,3 +1,10 @@ +OPEN LOOPS - 2025-11-12 + - websockets + - separate websocket handling from websocket parsing/sending + - do renaming + - make wfc not terrible + + VIDEO 1 - 2025-09-16 TODONE - add qhl as dep diff --git a/src/fd_clients.erl b/src/fd_http.erl similarity index 64% rename from src/fd_clients.erl rename to src/fd_http.erl index db23186..a1e513a 100644 --- a/src/fd_clients.erl +++ b/src/fd_http.erl @@ -8,7 +8,7 @@ %%% See: http://erlang.org/doc/apps/kernel/application.html %%% @end --module(fd_clients). +-module(fd_http). -vsn("0.1.0"). -behavior(supervisor). -author("Peter Harpending "). @@ -32,17 +32,17 @@ start_link() -> init(none) -> RestartStrategy = {rest_for_one, 1, 60}, - ClientMan = {fd_client_man, - {fd_client_man, start_link, []}, - permanent, - 5000, - worker, - [fd_client_man]}, - ClientSup = {fd_client_sup, - {fd_client_sup, start_link, []}, - permanent, - 5000, - supervisor, - [fd_client_sup]}, - Children = [ClientSup, ClientMan], + HttpClientMan = {fd_http_client_man, + {fd_http_client_man, start_link, []}, + permanent, + 5000, + worker, + [fd_http_client_man]}, + HttpClientSup = {fd_http_client_sup, + {fd_http_client_sup, start_link, []}, + permanent, + 5000, + supervisor, + [fd_http_client_sup]}, + Children = [HttpClientSup, HttpClientMan], {ok, {RestartStrategy, Children}}. diff --git a/src/fd_client.erl b/src/fd_http_client.erl similarity index 99% rename from src/fd_client.erl rename to src/fd_http_client.erl index f1ac0a3..f5c013a 100644 --- a/src/fd_client.erl +++ b/src/fd_http_client.erl @@ -13,7 +13,7 @@ %%% http://erlang.org/doc/design_principles/spec_proc.html %%% @end --module(fd_client). +-module(fd_http_client). -vsn("0.1.0"). -author("Peter Harpending "). -copyright("Peter Harpending "). diff --git a/src/fd_client_man.erl b/src/fd_http_client_man.erl similarity index 99% rename from src/fd_client_man.erl rename to src/fd_http_client_man.erl index 212058d..1bd6a40 100644 --- a/src/fd_client_man.erl +++ b/src/fd_http_client_man.erl @@ -9,7 +9,7 @@ %%% OTP should take care of for us. %%% @end --module(fd_client_man). +-module(fd_http_client_man). -vsn("0.1.0"). -behavior(gen_server). -author("Peter Harpending "). diff --git a/src/fd_client_sup.erl b/src/fd_http_client_sup.erl similarity index 98% rename from src/fd_client_sup.erl rename to src/fd_http_client_sup.erl index 8040311..23cea78 100644 --- a/src/fd_client_sup.erl +++ b/src/fd_http_client_sup.erl @@ -13,7 +13,7 @@ %%% http://erlang.org/doc/design_principles/sup_princ.html#id79244 %%% @end --module(fd_client_sup). +-module(fd_http_client_sup). -vsn("0.1.0"). -behaviour(supervisor). -author("Peter Harpending "). diff --git a/src/fd_sup.erl b/src/fd_sup.erl index 76859f3..7a01e81 100644 --- a/src/fd_sup.erl +++ b/src/fd_sup.erl @@ -36,8 +36,8 @@ start_link() -> init([]) -> RestartStrategy = {one_for_one, 1, 60}, - Clients = {fd_clients, - {fd_clients, start_link, []}, + Httpd = {fd_http, + {fd_http, start_link, []}, permanent, 5000, supervisor, @@ -60,5 +60,5 @@ init([]) -> 5000, worker, [fd_cache]}, - Children = [Clients, Chat, FileCache, Cache], + Children = [Httpd, Chat, FileCache, Cache], {ok, {RestartStrategy, Children}}. diff --git a/src/fewd.erl b/src/fewd.erl index 51a2f94..c4085e1 100644 --- a/src/fewd.erl +++ b/src/fewd.erl @@ -24,7 +24,7 @@ %% Returns an {error, Reason} tuple if it is already listening. listen(PortNum) -> - fd_client_man:listen(PortNum). + fd_http:listen(PortNum). -spec ignore() -> ok. @@ -32,7 +32,7 @@ listen(PortNum) -> %% Make the server stop listening if it is, or continue to do nothing if it isn't. ignore() -> - fd_client_man:ignore(). + fd_http:ignore(). -spec start(normal, term()) -> {ok, pid()}.