core-async

dgr 2025-10-19T17:21:22.289879Z

Throughout core.async, nil is used to signal a closed channel. I was looking at poll! earlier today and saw that it returns nil if there is no value currently available on the channel. How does poll! distinguish between value not available and channel closed?

Jan K 2025-10-19T17:28:32.900199Z

It returns nil for both, so it doesn't distinguish. But if you want to do that you can using alt! with a :default

👍 1