I’m curious about the workflow you use to reload some code that contains a server. My code looks like:
% Start the server when the code is loaded.
:- initialization(start).
% Start the server on port 8080
start :- http_server(http_dispatch, [port(8081)]).
but if I change something in the functions that implement the handlers, and issue make.
at the top-level, I get:
ERROR: [Thread 3] ~/code/prolog/example/server.pl:18: Initialization goal raised exception:
ERROR: [Thread 3] Socket error: Address already in use
What’s the workflow you would suggest here? In other programming languages that do heavy use of the repl, like clojure, we have facilities for closing the long lived resources and starting them again on reload, but can’t find more info on how to do that here.