Chris,
This example is from the "Synchronous Sends" article in the Concurrency
documentation:
: pong-server ( -- )
receive {
{ { ?from ?tag "ping" } [ ?tag "pong" 2array ?from send pong-server ] }
{ { ?from _ } [ ?tag "server shutdown" 2array ?from send ] }
} match-cond ;
[ pong-server ] spawn "ping" swap send-synchronous .
=> "pong"
If you send "ping" via 'send-synchronous', the server works. But if you send
anything else via 'send-synchronous', the server bombs out because there
isn't a matching clause. The second clause in the match-cond doesn't match a
tag. Perhaps you meant:
: pong-server ( -- )
receive {
{ { ?from ?tag "ping" } [ ?tag "pong" 2array ?from send pong-server ] }
{ { ?from ?tag _ } [ ?tag "server shutdown" 2array ?from send ] }
} match-cond ;
Ed
-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Factor-talk mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/factor-talk