Skip to content

Instantly share code, notes, and snippets.

@laczoka
Created August 11, 2014 15:28
Show Gist options
  • Save laczoka/84fc9f2f080b406c4d43 to your computer and use it in GitHub Desktop.
Save laczoka/84fc9f2f080b406c4d43 to your computer and use it in GitHub Desktop.
(ns blocking.core
(:require [org.httpkit.server :refer [run-server] :as http]))
(def c (atom 0))
(defn app-blocking [req]
(println "Serving blocking connect " (swap! c inc))
(Thread/sleep 3000)
{:status 200
:headers {"Content-Type" "text/plain"}
:body "hello HTTP!"})
(defn -main
[]
(run-server app-blocking {:port 8080 :thread 1})
(println "Server running"))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment