byte msg;
myChan ? < msg >;
http://spinroot.com/spin/Man/receive.html
]]>IF the channel chan1 is not empty:
Let X = chan1.pop()
do some stuff with X
But the only way I know how to do this is to explicitly enumerate all possible values of X, ie, if X were of some mtype { BANANA, HOTDOG, MANGO, KOALA }, I would do
mtype tmp;
if
:: chan1 ? BANANA -> tmp = BANANA;
:: chan1 ? HOTDOG -> tmp = HOTDOG;
:: chan1 ? MANGO -> tmp = MANGO;
:: chan1 ? KOALA -> tmp = KOALA;
fi
do some stuff with tmp
Is this the best way to do it? Or is there some method like the ".pop()" I want that I can use?
Thank you!
]]>