<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">


<META content="MSHTML 6.00.3790.2630" name=GENERATOR></HEAD>
<BODY>
<DIV><SPAN class=071504207-04042006><FONT face=Arial color=#0000ff size=2>I 
suspect you could get rid of the uselesstasklet by setting the 'preference' 
value</FONT></SPAN></DIV>
<DIV><SPAN class=071504207-04042006><FONT face=Arial color=#0000ff size=2>on 
the&nbsp;channel to some value,&nbsp;0 if I recall</FONT></SPAN><SPAN 
class=071504207-04042006><FONT face=Arial color=#0000ff size=2>.&nbsp; But you 
might have to read the C</FONT></SPAN></DIV>
<DIV><SPAN class=071504207-04042006><FONT face=Arial color=#0000ff size=2>source 
to know for sure.</FONT></SPAN></DIV>
<DIV><SPAN class=071504207-04042006><FONT face=Arial color=#0000ff 
size=2></FONT></SPAN>&nbsp;</DIV>
<DIV><SPAN class=071504207-04042006><FONT face=Arial color=#0000ff size=2>If 
someone&nbsp;sorts out how it works and sends me a more explanatory 
doc</FONT></SPAN></DIV>
<DIV><SPAN class=071504207-04042006><FONT face=Arial color=#0000ff 
size=2>string, I&nbsp;can check it in.&nbsp; Same for any of the other doc 
strings you may feel</FONT></SPAN></DIV>
<DIV><SPAN class=071504207-04042006><FONT face=Arial color=#0000ff size=2>are 
lacking.</FONT></SPAN></DIV>
<DIV><SPAN class=071504207-04042006><FONT face=Arial color=#0000ff 
size=2></FONT></SPAN>&nbsp;</DIV>
<DIV><SPAN class=071504207-04042006><FONT face=Arial color=#0000ff size=2>I 
don't think you need permission to change anything in the wiki.&nbsp; 
I</FONT></SPAN><SPAN class=071504207-04042006><FONT face=Arial color=#0000ff 
size=2>f anyone</FONT></SPAN></DIV>
<DIV><SPAN class=071504207-04042006><FONT face=Arial color=#0000ff size=2>wants 
any pages added, send me the name and I'll do </FONT></SPAN><SPAN 
class=071504207-04042006><FONT face=Arial color=#0000ff size=2>it myself as I 
don't</FONT></SPAN></DIV>
<DIV><SPAN class=071504207-04042006><FONT face=Arial color=#0000ff size=2>have 
any other solution for that problem.</FONT></SPAN></DIV>
<DIV><SPAN class=071504207-04042006><FONT face=Arial color=#0000ff 
size=2></FONT></SPAN>&nbsp;</DIV>
<DIV><SPAN class=071504207-04042006><FONT face=Arial color=#0000ff 
size=2>Richard.</FONT></SPAN></DIV>
<BLOCKQUOTE 
style="PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #0000ff 2px solid">
  <DIV class=OutlookMessageHeader dir=ltr align=left><FONT face=Tahoma 
  size=2>-----Original Message-----<BR><B>From:</B> 
  stackless-bounces@stackless.com [mailto:stackless-bounces@stackless.com]<B>On 
  Behalf Of </B>Benjamin Buco<BR><B>Sent:</B> 04 April 2006 01:35<BR><B>To:</B> 
  stackless@stackless.com<BR><B>Subject:</B> [Stackless] 
  Queues<BR><BR></FONT></DIV>
  <DIV>This is an implementation&nbsp; for what amounts to a queue or buffered 
  channel.&nbsp; Any suggestions, advice, criticism before I post this to the 
  wiki would be appreciated.&nbsp; Its probably not the cleanest solution but at 
  least it's pretty.&nbsp; Also anyone have any objections to me restoring the 
  link to the channels page to the main stackless page?</DIV>
  <DIV>&nbsp;</DIV>
  <DIV>&nbsp;</DIV>
  <DIV>import stackless</DIV>
  <DIV>class Queue(stackless.channel):<BR>&nbsp;&nbsp;&nbsp; def 
  uselesstasklet(self,value):<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
  return stackless.channel.send(self, value)<BR>&nbsp;&nbsp;&nbsp; def 
  send(self, value, wait=False):<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
  useless = 
  stackless.tasklet(self.uselesstasklet)(value)<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
  stackless.schedule(useless)<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
  return None<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </DIV>
  <DIV>def testQueue():<BR>&nbsp;&nbsp;&nbsp; print<BR>&nbsp;&nbsp;&nbsp; print 
  "testQueue"<BR>&nbsp;&nbsp;&nbsp; print 
  "--------------------"<BR>&nbsp;&nbsp;&nbsp; def recv(ch, 
  name):<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; print "Started 
  recv&lt;%s&gt;" % (name,)<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; print 
  "recv&lt;%s&gt;: %r" % (name, ch.receive())</DIV>
  <DIV>&nbsp;&nbsp;&nbsp; ch = Queue()</DIV>
  <DIV>&nbsp;&nbsp;&nbsp; # Queues are nonblocking on sends when there are no 
  receivers<BR>&nbsp;&nbsp;&nbsp; ch.send("Primary Entry")<BR>&nbsp;&nbsp;&nbsp; 
  ch.send("Secondary Entry")</DIV>
  <DIV>&nbsp;&nbsp;&nbsp; for name in 
  "ABCD":<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; task = 
  stackless.tasklet(recv)(ch, 
  name)<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; task.run()</DIV>
  <DIV>&nbsp;&nbsp;&nbsp; ch.send("Third Entry")<BR>&nbsp;&nbsp;&nbsp; 
  ch.send("Fourth Entry")<BR>&nbsp;&nbsp;&nbsp; print</DIV>
  <DIV>testQueue()</DIV>
  <DIV>&nbsp;</DIV>
  <DIV>Thanks guys.</DIV>
  <DIV>&nbsp;</DIV>
  <DIV>Benjamin Buco</DIV>
  <DIV>MCSE:Security</DIV>
  <DIV>IT Instructor</DIV>
  <DIV>TechSkills Cincinnati</DIV>
  <P>
  <HR SIZE=1>
  Blab-away for as little as 1¢/min. Make <A 
  href="http://us.rd.yahoo.com/mail_us/taglines/postman2/*http://us.rd.yahoo.com/evt=39663/*http://voice.yahoo.com">PC-to-Phone 
  Calls</A> using Yahoo! Messenger with Voice.</BLOCKQUOTE></BODY></HTML>