Reputation: 1552
I am trying to learn about Promise in clojure. From the docs, I can see we can create promise using promise function:
(def p (promise))
and we can resolve it using deliver function like this
(deliver p 42)
I want to understand, how can we reject a promise with error or exception. I've tried docs but it doesn't seems to help. I am new to functional programming and wondering there could be a different way for failed promises.
Upvotes: 3
Views: 253
Reputation: 7
You can use fail function to reject a promise.
Please refer to this link for more details.
Upvotes: -1