Futurama is a Clojure library for more deeply integrating async abstractions in the Clojure and JVM ecosystem with Clojure core.async.
It adds support for CompletableFuture and IDeferred to be used in the same fashion as Clojure core.async channels.
Here's a simple example.
(ns user
(:require [futurama.core :refer [async !<!! !<!]])
(:import [java.util.concurrent CompletableFuture]))
(defn future-thing
[what]
(CompletableFuture/completedFuture (format "%s: done" what)))
(async
(println (!<! (future-thing "laundry"))))
;;; => prints out: "laundry: done"
See the existing tests for more examples.
Futurama is built, tested, and deployed using Clojure Tools Deps.
CMake is used to simplify invocation of some commands.
Futurama releases for this project are on Clojars. Simply add the following to your project:
See CONTRIBUTING.md
Copyright 2024 Jose Gomez
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Can you improve this documentation?Edit on GitHub
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close