Skip to content

k7d/hop

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Hop

Hop is a minimalistic asynchronous web server for Clojure designed to be used in concert with core.async.

Hop's request and response formats are compatible with Ring. Hop's request handlers however must return core.async channel and supply the response via the channel.

Under the hood, Hop is built on top of Netty framework.

Example

(ns hello-world.core
  (:require [clojure.core.async :refer [go <! timeout]]
            [hop.server :as server]))

(defn handler [req]
  (go
    ; simulate wait (in real world this would be waiting for some I/O to happen)
    (<! (timeout 1000))
    {:status 200
     :headers {"Content-Type" "text/plain"}
     :body "Hello World"}))

(defn -main [& args]
  (server/start-server handler))

About

Minimalistic non-blocking web server for Clojure

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published