197f265
Branches > main > 197f265 > files / src / net / bowmap / server / network
Make run-server! block rather than returning a future
Commit: 197f2659755c1a5eb1dfa567f64344aaf0bf0b45
Parent: a6f37e8
2 changed files:
src/net/bowmap/server/core.clj view file
@@ -6,4 +6,4 @@ (defn -main [& _args] (spit ".nrepl-port" (req! (nrepl/start-server) :port))- @(server/run-server! (mc/server :port 25565)))+ (server/run-server! (mc/server :port 25565)))src/net/bowmap/server/runtime/server.clj view file
@@ -25,10 +25,9 @@ (defn run-server! "Starts running the given server, where server is a channel of connections.- Returns a future that delivers when the server closes."+ Blocks until the server closes." [server]- (future- (loop []- (when-some [connection (<!! server)]- (handle-connection! connection)- (recur)))))+ (loop []+ (when-some [connection (<!! server)]+ (handle-connection! connection)+ (recur))))