<div dir="ltr">Oh, right: so you probably don't want 'get' 'put' and 'is-full?' but you want 'get' and 'try-put' that fails only when the channel is full, returning a boolean to indicate success.<div>
<br></div><div>Robby</div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Mon, Dec 2, 2013 at 11:24 PM, David T. Pierson <span dir="ltr"><<a href="mailto:dtp@mindstory.com" target="_blank">dtp@mindstory.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="im">On Fri, Nov 29, 2013 at 12:23:42PM -0800, Eric Dobson wrote:<br>
> I'm trying to make a custom output port that is backed by a<br>
> async-channel. One of the operations that ports need to provide is an<br>
> event that is ready when progress on the event can be made. But since<br>
> I cannot tell if the async-channel is full and put would not block<br>
> without actually sending a value, I cannot provide such an event. Is<br>
> it possible to provide such an API or does the implementation of<br>
> async-channels prevent this?<br>
<br>
</div>I don't know much about creating custom ports, so I looked up progress<br>
events in order to understand your question better. But now I'm<br>
confused, because progress events seem to be specific to input ports,<br>
whereas it sounds like you are creating an output port. What am I<br>
missing?<br>
<br>
Regarding your actual question: I think the reason a non-side-effecting<br>
async-channel-put-evt is not provided is that using such an event could<br>
lead to race conditions. A previous thread [1] on this list touched on<br>
this with regard to places and channels as events; I'm extrapolating to<br>
extend that answer to async-channel-put-evt.<br>
<br>
David<br>
<br>
[1] <a href="http://www.mail-archive.com/users@racket-lang.org/msg15630.html" target="_blank">http://www.mail-archive.com/users@racket-lang.org/msg15630.html</a><br>
<div class="HOEnZb"><div class="h5">____________________<br>
Racket Users list:<br>
<a href="http://lists.racket-lang.org/users" target="_blank">http://lists.racket-lang.org/users</a><br>
</div></div></blockquote></div><br></div>