File tree Expand file tree Collapse file tree 3 files changed +12
-8
lines changed Expand file tree Collapse file tree 3 files changed +12
-8
lines changed Original file line number Diff line number Diff line change 2
2
org.clojure/core.async {:mvn/version " 1.5.648" }
3
3
camel-snake-kebab/camel-snake-kebab {:mvn/version " 0.4.3" }
4
4
cheshire/cheshire {:mvn/version " 5.11.0" }
5
- funcool/promesa {:mvn/version " 10.0.571 " }}
5
+ funcool/promesa {:mvn/version " 10.0.594 " }}
6
6
:paths [" src" " resources" ]
7
7
:aliases {:test {:extra-deps {lambdaisland/kaocha {:mvn/version " 1.64.1010" }}
8
8
:extra-paths [" test" ]
Original file line number Diff line number Diff line change 38
38
(deref [_ timeout-ms timeout-val]
39
39
(deref p timeout-ms timeout-val))
40
40
IBlockingDerefOrCancel
41
- (deref-or-cancel [this timeout-ms timeout-val]
41
+ (deref-or-cancel [_ timeout-ms timeout-val]
42
42
(let [result (deref p timeout-ms ::timeout )]
43
43
(if (identical? ::timeout result)
44
- (do (future- cancel this )
44
+ (do (p/ cancel! p )
45
45
timeout-val)
46
46
result)))
47
47
clojure.lang.IPending
Original file line number Diff line number Diff line change 385
385
_ (server/start server nil )
386
386
req (p/promise (server/send-request server " req" {:body " foo" }))
387
387
client-rcvd-msg (h/assert-take output-ch)]
388
- (async/put! input-ch (lsp.responses/response (:id client-rcvd-msg) {:processed 1 }))
389
- (is (= {:processed 2 } (-> req
390
- (p/timeout 1000 :test-timeout )
391
- (p/then #(update % :processed inc))
392
- (p/extract ))))
388
+ (async/put! input-ch (lsp.responses/response (:id client-rcvd-msg) {:result :processed
389
+ :value 1 }))
390
+ (is (= {:result :processed
391
+ :value 2 }
392
+ (-> req
393
+ (p/timeout 1000 {:result :test-timeout
394
+ :value 1 })
395
+ (p/then #(update % :value inc))
396
+ (deref ))))
393
397
(is (p/done? req))
394
398
(is (p/resolved? req))
395
399
(is (not (p/rejected? req)))
You can’t perform that action at this time.
0 commit comments