clj-commons / manifold

A compatibility layer for event-driven abstractions
1.02k stars 106 forks source link

Allow deferreds to use clojure.core deref timeouts #21

Closed benmoss closed 9 years ago

benmoss commented 9 years ago

Prior to this (deref (manifold.deferred/deferred) 10 :ok) would throw a NullPointerException. This patch seems like it keeps all the prior behavior of using the val to hold a TimeoutException and whatnot, but allows this normal use-case to work as well.

ztellman commented 9 years ago

The issue here was I was ignoring the .await() return value. Your fix wasn't quite right either, so I made a different change. Thanks for bringing this to my attention, though.