{"id":26066190,"url":"https://github.com/jtkdvlp/core.async-helpers","last_synced_at":"2025-04-11T15:32:50.213Z","repository":{"id":57716718,"uuid":"289118091","full_name":"jtkDvlp/core.async-helpers","owner":"jtkDvlp","description":"Helper pack for core.async","archived":false,"fork":false,"pushed_at":"2025-02-05T22:10:44.000Z","size":43,"stargazers_count":5,"open_issues_count":1,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-25T11:49:11.056Z","etag":null,"topics":["async","callback","clojure","clojurescript","error-handling","error-propagation","exception-handling","promise"],"latest_commit_sha":null,"homepage":"","language":"Clojure","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"epl-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jtkDvlp.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-08-20T21:53:27.000Z","updated_at":"2025-02-05T22:10:30.000Z","dependencies_parsed_at":"2025-02-05T22:31:47.143Z","dependency_job_id":"9bcb800c-67a9-4989-a40c-43722e7e0a9f","html_url":"https://github.com/jtkDvlp/core.async-helpers","commit_stats":null,"previous_names":[],"tags_count":14,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jtkDvlp%2Fcore.async-helpers","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jtkDvlp%2Fcore.async-helpers/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jtkDvlp%2Fcore.async-helpers/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jtkDvlp%2Fcore.async-helpers/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jtkDvlp","download_url":"https://codeload.github.com/jtkDvlp/core.async-helpers/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248431821,"owners_count":21102274,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["async","callback","clojure","clojurescript","error-handling","error-propagation","exception-handling","promise"],"created_at":"2025-03-08T20:08:22.287Z","updated_at":"2025-04-11T15:32:50.194Z","avatar_url":"https://github.com/jtkDvlp.png","language":"Clojure","funding_links":["https://www.paypal.com/donate?hosted_button_id=2PDXQMHX56T6U"],"categories":[],"sub_categories":[],"readme":"[![Clojars Project](https://img.shields.io/clojars/v/jtk-dvlp/core.async-helpers.svg)](https://clojars.org/jtk-dvlp/core.async-helpers)\n[![cljdoc badge](https://cljdoc.org/badge/jtk-dvlp/core.async-helpers)](https://cljdoc.org/d/jtk-dvlp/core.async-helpers/CURRENT)\n[![License](https://img.shields.io/badge/License-EPL%202.0-red.svg)](https://opensource.org/licenses/EPL-2.0)\n[![paypal](https://www.paypalobjects.com/en_US/i/btn/btn_donate_SM.gif)](https://www.paypal.com/donate?hosted_button_id=2PDXQMHX56T6U)\n\n# Helpers for core.async\n\nHelper pack for [core.async](https://github.com/clojure/core.async) with focus on error propagation, see [docs](https://cljdoc.org/d/jtk-dvlp/core.async-helpers/CURRENT) for more and examples.\n\n## Features\n\n  * error propagation by climbing up the go block stack via [go](https://cljdoc.org/d/jtk-dvlp/core.async-helpers/CURRENT/api/jtk-dvlp.async#go) / [go-loop](https://cljdoc.org/d/jtk-dvlp/core.async-helpers/CURRENT/api/jtk-dvlp.async#go-loop) / [map](https://cljdoc.org/d/jtk-dvlp/core.async-helpers/CURRENT/api/jtk-dvlp.async#map) / [reduce](https://cljdoc.org/d/jtk-dvlp/core.async-helpers/CURRENT/api/jtk-dvlp.async#reduce) / [\u003c!](https://cljdoc.org/d/jtk-dvlp/core.async-helpers/CURRENT/api/jtk-dvlp.async#\u003c!) / [\u003c?](https://cljdoc.org/d/jtk-dvlp/core.async-helpers/CURRENT/api/jtk-dvlp.async#\u003c?) and [more](https://cljdoc.org/d/jtk-dvlp/core.async-helpers/CURRENT/api/jtk-dvlp.async) (all functions within this package propagate errors)\n  * promise channel helpers\n    * to ensure promise-chan via [promise-go](https://cljdoc.org/d/jtk-dvlp/core.async-helpers/CURRENT/api/jtk-dvlp.async.interop.promise#promise-go) [-\u003epromise-chan](https://cljdoc.org/d/jtk-dvlp/core.async-helpers/CURRENT/api/jtk-dvlp.async.interop.promise#-\u003epromise-chan) and its behavior\n    * to create promise-chan via [promise-chan](https://cljdoc.org/d/jtk-dvlp/core.async-helpers/CURRENT/api/jtk-dvlp.async.interop.promise#promise-chan) function with resolve and reject handlers\n    * conversion from channel to promise and vice versa via [c-\u003ep](https://cljdoc.org/d/jtk-dvlp/core.async-helpers/CURRENT/api/jtk-dvlp.async.inertop.promise#c-\u003ep), [p-\u003ec](https://cljdoc.org/d/jtk-dvlp/core.async-helpers/CURRENT/api/jtk-dvlp.async.inertop.promise#p-\u003ec) and [\u003c!p](https://cljdoc.org/d/jtk-dvlp/core.async-helpers/CURRENT/api/jtk-dvlp.async.interop.promise#\u003c!p)\n  * helpers to handle callback based functions by conversion into channel via [cb-\u003ec](https://cljdoc.org/d/jtk-dvlp/core.async-helpers/CURRENT/api/jtk-dvlp.async.interop.callback#cb-\u003ec) and [\u003ccb!](https://cljdoc.org/d/jtk-dvlp/core.async-helpers/CURRENT/api/jtk-dvlp.async.interop.callback#\u003ccb!)\n\n## Getting started\n\n### Get it / add dependency\n\nAdd the following dependency to your `project.clj`:\u003cbr\u003e\n[![Clojars Project](https://img.shields.io/clojars/v/jtk-dvlp/core.async-helpers.svg)](https://clojars.org/jtk-dvlp/core.async-helpers)\n\n### Usage\n\nPay attention mixing up error propagation functions of this library and clojure.core.async functions. clojure.core.async function do not propagate errors. E.g. using a core.async go-block within a error propagation go-block stack will break error propagation. So do not mix it up!\n\n```clojure\n(ns your-project\n  #?(:clj\n     (:require\n      [clojure.core.async :refer [timeout]]\n      [jtk-dvlp.async :as a])\n\n     :cljs\n     (:require\n      [cljs.core.async :refer [timeout]]\n      [jtk-dvlp.async :as a]))\n\n  #?(:clj\n     (:import\n      [clojure.lang ExceptionInfo]))\n\n  ,,,)\n\n\n(defn \u003cdo-some-async-stuff\n  [\u0026 args]\n  (a/go\n    (a/\u003c! (timeout 1000))\n    (let [result\n          {:call-args args}]\n\n      (println result)\n      result)))\n\n(defn \u003cfail-during-some-async-stuff\n  [\u0026 args]\n  (a/go\n    (a/\u003c! (timeout 1000))\n    (-\u003e\u003e {:call-args args}\n         (ex-info \"you got a bug\")\n         (throw))))\n\n(comment\n  (a/go\n    (try\n      (let [a\n            (a/\u003c! (\u003cdo-some-async-stuff :a))\n\n            b\n            (a/\u003c! (\u003cfail-during-some-async-stuff :b))\n\n            c\n            (a/\u003c! (\u003cdo-some-async-stuff :c))]\n\n        (println [a b c]))\n\n      (catch ExceptionInfo e\n        (println \"there is an error\" e))))\n\n  ,,,)\n```\n\n\n## Appendix\n\nI´d be thankful to receive patches, comments and constructive criticism.\n\nHope the package is useful :-)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjtkdvlp%2Fcore.async-helpers","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjtkdvlp%2Fcore.async-helpers","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjtkdvlp%2Fcore.async-helpers/lists"}