This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2023-02-01
Channels
- # announcements (14)
- # architecture (30)
- # aws (34)
- # babashka (18)
- # beginners (114)
- # biff (5)
- # calva (128)
- # clerk (155)
- # clj-kondo (60)
- # clojure (82)
- # clojure-dev (25)
- # clojure-europe (20)
- # clojure-nl (1)
- # clojure-norway (17)
- # clojure-spec (13)
- # clojure-uk (3)
- # community-development (4)
- # core-logic (4)
- # cursive (5)
- # datomic (21)
- # deps-new (13)
- # emacs (5)
- # funcool (5)
- # graphql (3)
- # hyperfiddle (1)
- # introduce-yourself (1)
- # jobs (2)
- # kaocha (1)
- # london-clojurians (1)
- # lsp (13)
- # malli (16)
- # off-topic (6)
- # other-languages (1)
- # pathom (18)
- # re-frame (23)
- # releases (1)
- # remote-jobs (2)
- # tools-build (1)
- # tools-deps (12)
- # vscode (1)
- # xtdb (27)
working with promesa.exec.csp
... there's a slight semantic difference in noticed from manifold and core.async in that:
(sp/put ch :foo)
(sp/close! ch)
@(sp/take ch) ;=> nil
results in nil
(i.e. the channel closes before the put
happens), whereas with similar manifold and core.async sequences the result would be :foo
- presumably because they are both doing some synchronous queueing of put
s, whereas promesa.exec.csp
is parking until there is a consumer and that never happens
i'm not sure this is a bad thing though ... it's easy enough to compensate for, and put
ing without waiting on the result is perhaps a code smell anywayanyway, i did a promesa.exec.csp
based implementation for my manifold-a-like lib, and it mostly works (still got a few test errors to work through): https://github.com/yapsterapp/promisespromises/blob/e1380827b36652a2b8ad6b03b065288f19f573ec/src/prpr3/stream/promesa_csp.cljc
yep, it is expected behavior difference, and it depends on the channel type. core.async preserves all pending puts to the channel when you call close!, this is why, after a close you can take! it.
promesa on the other hand, clears all queues on close, and resolves with nil
all pending operations.