Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/funcool/promesa
A promise library & concurrency toolkit for Clojure and ClojureScript.
https://github.com/funcool/promesa
async-await asynchronous-programming clojure clojurescript completablefuture concurrency deferred non-blocking promises threads virtual-threads
Last synced: 2 months ago
JSON representation
A promise library & concurrency toolkit for Clojure and ClojureScript.
- Host: GitHub
- URL: https://github.com/funcool/promesa
- Owner: funcool
- License: mpl-2.0
- Created: 2015-03-25T20:39:35.000Z (almost 10 years ago)
- Default Branch: master
- Last Pushed: 2024-08-19T18:36:44.000Z (5 months ago)
- Last Synced: 2024-10-28T13:41:55.233Z (3 months ago)
- Topics: async-await, asynchronous-programming, clojure, clojurescript, completablefuture, concurrency, deferred, non-blocking, promises, threads, virtual-threads
- Language: Clojure
- Homepage: https://funcool.github.io/promesa/latest/
- Size: 1.3 MB
- Stars: 496
- Watchers: 16
- Forks: 58
- Open Issues: 19
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Funding: .github/FUNDING.yml
- License: LICENSE
Awesome Lists containing this project
README
# promesa #
[![Clojars Project](http://clojars.org/funcool/promesa/latest-version.svg)](http://clojars.org/funcool/promesa)
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][1].
## Getting Started
deps.edn:
```clojure
funcool/promesa {:mvn/version "11.0.678"}
```Leiningen:
```clojure
[funcool/promesa "11.0.678"]
```## On the REPL
```clojure
(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:
``` shell
clojure -X:dev:test
```Run the ClojureScript (.cljs) tests:
``` shell
npm install
npm test
```[1]: https://funcool.github.io/promesa/latest/