I think the point is to not generate values by producer if external
service is not available
"The producer only unparks when the value is effectively consumed by
the external service. That's my objective."

"external ready" channel here serves as a latch that stops producer
generating value.

On Thu, Oct 9, 2014 at 6:39 AM, Fluid Dynamics <a2093...@trbvm.com> wrote:
> On Monday, October 6, 2014 9:36:59 AM UTC-4, edbond wrote:
>>
>> Add one more chan, "external ready".
>> Put :ok there to let producer generate new value.
>>
>> producer:
>> - read from "external ready"
>> - generate value
>> - put into "outgoing" chan
>>
>> client:
>> - contact external server, put in "external ready" if ok
>> - read from "outgoing" chan
>> - send to external
>>
>> Handle exceptions and loop where you need.
>
>
> If you're not reading from "outgoing" until the external server is known to
> be ready, you don't need the "external ready" channel. Backpressure on the
> "outgoing" channel will suffice to keep the producer from overrunning the
> consumer in this case.
>
> --
> You received this message because you are subscribed to the Google
> Groups "Clojure" group.
> To post to this group, send email to clojure@googlegroups.com
> Note that posts from new members are moderated - please be patient with your
> first post.
> To unsubscribe from this group, send email to
> clojure+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/clojure?hl=en
> ---
> You received this message because you are subscribed to a topic in the
> Google Groups "Clojure" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/clojure/QbiwXYDw6oA/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to
> clojure+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to