Skip to content

Commit 2df07dd

Browse files
committed
Move example into dev
1 parent ed93723 commit 2df07dd

File tree

2 files changed

+47
-1
lines changed

2 files changed

+47
-1
lines changed

dev/your_project.clj

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
(ns your-project
2+
(:require [jtk-dvlp.async :as a]))
3+
4+
5+
(defn ?do-some-async-stuff
6+
[& args]
7+
(a/go*
8+
(Thread/sleep 1000)
9+
(let [result
10+
{:thread-id (.getId (Thread/currentThread))
11+
:call-args args}]
12+
13+
(println result)
14+
result)))
15+
16+
(defn ?fail-during-some-async-stuff
17+
[& args]
18+
(a/go*
19+
(Thread/sleep 1000)
20+
(->> {:thread-id (.getId (Thread/currentThread))
21+
:call-args args}
22+
(ex-info "you got a bug")
23+
(throw))))
24+
25+
(defn ?do-some-more-stuff
26+
[]
27+
(a/go*
28+
(let [a
29+
(a/<e! (?do-some-async-stuff :a))
30+
31+
b
32+
(a/<e! (?fail-during-some-async-stuff :b))
33+
34+
c
35+
(a/<e! (?do-some-async-stuff :c))]
36+
37+
[a b c])))
38+
39+
(comment
40+
(a/go*
41+
(try
42+
(->> (?do-some-more-stuff)
43+
(a/<e!)
44+
(println "success"))
45+
(catch clojure.lang.ExceptionInfo e
46+
(println "there is an error" e)))))

project.clj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
(defproject jtk-dvlp/core.async-helpers "1.1.0"
1+
(defproject jtk-dvlp/core.async-helpers "1.1.1"
22
:description
33
"Helper pack for core.async"
44

0 commit comments

Comments
 (0)