aleph を使用して、イベントベースの websocket ハンドラーを作成しました。コア ファイルは次のようになります。
(defn handle-message
"Handle a message"
[message]
(event/dispatch message))
(defn websocket-handler
"Handle websocket connections."
[client-node connection-data]
(map* #(handle-message (message/create client-node connection-data %)) client-node))
(defn -main
"Start the http server and start handling websocket connections."
[& args]
(myapp.routes.api/add-events)
(start-http-server websocket-handler {:port 8080 :websocket true}))
これは正常に機能し、機能して期待される出力を提供するイベントがいくつかあります。ページをリロードすると、機能しなくなります。どうしたの?切断/再接続が発生していると思います。サーバー側で切断を管理するにはどうすればよいですか?