Browse Source

Remove Clojure/immutant entry (#4797)

* Remove Clojure/Immutant entry

This is superseded by Clojure/reitit

* Faster plain-text handling with reitit
Tommi Reiman 6 years ago
parent
commit
96e5f99f8d

+ 0 - 25
frameworks/Clojure/immutant/README.md

@@ -1,25 +0,0 @@
-# Immutant Benchmarking Test
-
-This is the [Immutant](http://immutant.org/) portion of a [benchmarking test suite](../) comparing a variety of web development platforms.
-
-### JSON Encoding Test
-
-* [JSON test source](hello/src/hello/handler.clj)
-
-## Infrastructure Software Versions
-
-The dependencies are documented in [project.clj](hello/project.clj),
-but the main ones are:
-
-* [Clojure 1.9.0](http://clojure.org/)
-* [ikitommi/immutant-web "3.0.0-alpha1"](https://github.com/ikitommi/immutant) - a performant fork of [Immutant]((http://immutant.org/))
-* [metosin/jsonista "0.2.0"](https://github.com/metosin/jsonista)
-
-## Test URLs
-### JSON Encoding Test
-
-http://localhost:8080/json
-
-### Plaintext Test
-
-http://localhost:8080/plaintext

+ 0 - 24
frameworks/Clojure/immutant/benchmark_config.json

@@ -1,24 +0,0 @@
-{
-  "framework": "immutant",
-  "tests": [{
-    "default": {
-      "json_url": "/json",
-      "plaintext_url": "/plaintext",
-      "port": 8080,
-      "approach": "Realistic",
-      "classification": "Micro",
-      "database": "None",
-      "framework": "immutant",
-      "language": "Clojure",
-      "flavor": "None",
-      "orm": "Raw",
-      "platform": "Undertow",
-      "webserver": "None",
-      "os": "Linux",
-      "database_os": "Linux",
-      "display_name": "immutant",
-      "notes": "",
-      "versus": "Undertow"
-    }
-  }]
-}

+ 0 - 6
frameworks/Clojure/immutant/immutant.dockerfile

@@ -1,6 +0,0 @@
-FROM clojure:lein-2.8.1
-WORKDIR /immutant
-COPY src src
-COPY project.clj project.clj
-RUN lein uberjar
-CMD ["java", "-server", "-XX:+UseNUMA", "-XX:+UseParallelGC", "-XX:+AggressiveOpts", "-jar", "target/hello-immutant-standalone.jar"]

+ 0 - 8
frameworks/Clojure/immutant/project.clj

@@ -1,8 +0,0 @@
-(defproject hello "immutant"
-  :description "Immutant, Jsonista"
-  :dependencies [[org.clojure/clojure "1.9.0"]
-                 [ikitommi/immutant-web "3.0.0-alpha1"]
-                 [metosin/jsonista "0.2.0"]]
-  :jvm-opts ^:replace ["-Dclojure.compiler.direct-linking=true"]
-  :main hello.handler
-  :aot :all)

+ 0 - 26
frameworks/Clojure/immutant/src/hello/handler.clj

@@ -1,26 +0,0 @@
-(ns hello.handler
-  (:require [immutant.web :as web]
-            [jsonista.core :as json])
-  (:gen-class))
-
-(def plaintext-response
-  {:status 200
-   :headers {"content-type" "text/plain; charset=utf-8"}
-   :body (.getBytes "Hello, World!")})
-
-(defn app [req]
-  (let [uri (:uri req)]
-    (cond
-      (.equals "/plaintext" uri) plaintext-response
-      (.equals "/json" uri) {:status 200
-                             :headers {"content-type" "application/json"}
-                             :body (json/write-value-as-bytes {:message "Hello, World!"})}
-      :else {:status 404})))
-
-(defn -main [& _]
-  (web/run
-    app
-    {:port 8080
-     :host "0.0.0.0"
-     :dispatch? false
-     :server {:always-set-keep-alive false}}))

+ 0 - 7
frameworks/Clojure/immutant/src/log4j.xml

@@ -1,7 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" ?>
-<!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">
-<log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/">
-  <logger name="com.mchange">
-    <level value="WARN"/>
-  </logger>
-</log4j:configuration>

+ 2 - 2
frameworks/Clojure/reitit/project.clj

@@ -1,12 +1,12 @@
 (defproject hello "reitit"
   :description "Immutant-nio, Reitit, Jsonista & Porsas"
   :dependencies [[org.clojure/clojure "1.10.0"]
-                 [ikitommi/immutant-web "3.0.0-alpha2"]
+                 [ikitommi/immutant-web "3.0.0-alpha3"]
                  [metosin/jsonista "0.2.2"]
                  [hikari-cp "2.7.1"]
                  [org.postgresql/postgresql "42.2.5"]
                  [metosin/porsas "0.0.1-alpha4"]
-                 [metosin/reitit "0.3.3"]]
+                 [metosin/reitit "0.3.4"]]
   :jvm-opts ^:replace ["-Dclojure.compiler.direct-linking=true"]
   :main hello.handler
   :aot :all)

+ 1 - 1
frameworks/Clojure/reitit/src/hello/handler.clj

@@ -41,7 +41,7 @@
     (web/run
       (ring/ring-handler
         (ring/router
-          [["/plaintext" plain-text-handler]
+          [["/plaintext" (web/constantly plain-text-handler)]
            ["/json" json-handler]
            ["/db" (web/dispatch (db-handler ds))]])
         (ring/create-default-handler)