[racket-users] How to check a place-channel for a message without blocking?

2015-09-01 Thread Charles Hixson
Is there a way to check whether there is a message available to be picked up on a place-channel without blocking? (If there isn't, the only way forwards for me in Racket is via a server. possibly a tcp server, though I don't really want the handshake. Possibly a Unix Socket Server. Possibly

[racket-users] How to check a place-channel for a message without blocking?

2015-08-31 Thread charleshixsn
Is there a way to check whether there is a message available to be picked up on a place-channel without blocking? (If there isn't, the only way forwards for me in Racket is via a server. possibly a tcp server, though I don't really want the handshake. Possibly a Unix Socket Server. Possibly

Re: [racket-users] How to check a place-channel for a message without blocking?

2015-08-31 Thread Robby Findler
The usual way to do this is by building your own syncronization pattern using an extra thread. There are situations where that isn't efficient enough, but it often works great. Threads in racket aren't heavy weight and using this "CML style" of programming is very flexible and naturally leads to

Re: [racket-users] How to check a place-channel for a message without blocking?

2015-08-31 Thread charleshixsn
On Monday, August 31, 2015 at 4:21:37 PM UTC-7, Robby Findler wrote: > The usual way to do this is by building your own syncronization > pattern using an extra thread. There are situations where that isn't > efficient enough, but it often works great. Threads in racket aren't > heavy weight and

Re: [racket-users] How to check a place-channel for a message without blocking?

2015-08-31 Thread Robby Findler
Yes, right! I agree that for a simple thing like just checking availability of a message it feels like a lot. But when you get more complex syncronization patterns it scales up very nicely. Robby On Mon, Aug 31, 2015 at 6:54 PM, wrote: > On Monday, August 31, 2015

Re: [racket-users] How to check a place-channel for a message without blocking?

2015-08-31 Thread charleshixsn
On Monday, August 31, 2015 at 4:58:01 PM UTC-7, Robby Findler wrote: > Yes, right! > > I agree that for a simple thing like just checking availability of a > message it feels like a lot. But when you get more complex > syncronization patterns it scales up very nicely. > > Robby > > > On Mon,

Re: [racket-users] How to check a place-channel for a message without blocking?

2015-08-31 Thread Robby Findler
Oh, and I should point out that I forgot about sync/timeout. If you pass 0 as the timeout, you can get the behavior you were asking for. Sorry about that. Robby On Mon, Aug 31, 2015 at 7:51 PM, wrote: > On Monday, August 31, 2015 at 4:58:01 PM UTC-7, Robby Findler