The Wayback Machine - https://web.archive.org/web/20231027104442/https://github.com/funcool/promesa
Skip to content

funcool/promesa

master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
September 28, 2022 17:15
doc
February 13, 2023 15:07
November 22, 2022 12:07
October 21, 2023 11:20
November 8, 2022 17:39
October 15, 2022 21:42
August 22, 2023 10:55
May 20, 2023 17:16
May 20, 2023 17:16
November 13, 2022 22:46
March 9, 2023 12:43
March 9, 2023 12:43
May 21, 2023 18:45
February 22, 2022 09:27

promesa

Clojars Project

A promise library & concurrency toolkit for Clojure and ClojureScript.

This library exposes a bunch of usefull syntactic abstractions that will considerably simplify to work with promises (in a very similar way as you will do it in JS with async/await) and many helpers from executors to concurrency patterns (bulkhead & CSP). With 0 runtime external dependencies.

Here you can look a detailed documentation.

Getting Started

deps.edn:

funcool/promesa {:mvn/version "11.0.678"}

Leiningen:

[funcool/promesa "11.0.678"]

On the REPL

(require '[promesa.core :as p])

(->> (p/promise 1)
     (p/map inc)
     (deref)
;; => 2

NOTE: example only work on JVM because the evident lack of blocking primitives on JS runtime.

Contributing

If you miss something, feel free to open an issue for a discussion. If there is a clear use case for the proposed enhacement, the PR will be more than welcome.

Testing

Run the Clojure (.clj) tests:

clojure -X:dev:test

Run the ClojureScript (.cljs) tests:

npm install
npm test