Fork me on GitHub
#funcool
<
2023-06-25
>
Aziz Aldawood14:06:21

I want this to return empty when the channel is empty. without a timeout this call get stuck. is adding a timeout the proper way to do this or is there a different way?

(if-let [v (sp/take! channel)]
  v
  "empty")

Aziz Aldawood14:06:06

it doesn't feel right

Aziz Aldawood14:06:12

is sp/poll! the right function to use?

Aziz Aldawood19:06:14

nevermind I was doing something wrong