This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| {:deps {org.clojure/clojure {:mvn/version "1.11.1"} | |
| org.apache.kafka/kafka-clients {:mvn/version "3.3.1"} | |
| missionary/missionary {:mvn/version "b.26"}}} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| (ns prepl | |
| (:require [clojure.core.server :as s] | |
| [missionary.core :as m]) | |
| (:import (java.io PipedReader PipedWriter) | |
| (java.util.concurrent Executors))) | |
| (defn remote " | |
| Returns a function taking a `java.io.PipedWriter` and returning a flow connecting to a remote prepl on given `host` and | |
| `port`, sending the content of the pipe to the remote peer and emitting received evaluation results. The pipe is closed | |
| on flow cancellation. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| (ns animation | |
| (:refer-clojure :exclude [cycle]) | |
| (:require [missionary.core :as m])) | |
| ;; A signal giving the current time in milliseconds. | |
| ;; On the browser, you may want to use an RAF-based clock instead. | |
| (def <time | |
| (->> (m/ap | |
| (loop [] | |
| (m/amb nil |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| (ns promise) | |
| (defmacro with-abort " | |
| Returns a task evaluating `body` with symbol `a` bound to a fresh `AbortSignal` that is aborted when the task is | |
| cancelled. The task completes with the result of returned promise. | |
| " [a & body] | |
| `(fn [s# f#] | |
| (let [c# (js/AbortController.) | |
| ~a (.-signal c#)] | |
| (try (.then (do ~@body) s# f#) |
OlderNewer