<div dir="ltr">sorry, <div><br></div><div>patch_all seemed to simple, question was a bit rethoric ;-) tried it 2 mins after pressing send just in case and indeed no cigar.</div><div><br></div><div>I am trying to get this demo running and all kinds of last minute #### is popping up.<div>
<br></div><div>I tried reading the source but it doesn't click; i am not familiar with using sockets etc. at all.</div><div><br></div><div>e.g.</div><div><br></div><div>- do i need 'stacklessio'?</div></div><div>
- can i (essentially) just put a stackless.schedule() (or OpenTasklets.schedule() in the code below) in the serve_forever loop?</div><div>- will this work at all with an adapted scheduler like this:</div><div><br></div><div>
<div>class OpenTasklets(object):</div><div>    </div><div>    _stop = False</div><div>    </div><div>    @classmethod</div><div>    def run(cls, maxcount = None):</div><div>        cls.schedule_channel = stackless.channel()<br>
</div><div>        cls.schedule_channel.preference = 1</div><div>        counter = 0</div><div>        OpenTasklets._stop = False</div><div>        while stackless.getruncount() != 1:</div><div>            stackless.run()</div>
<div>            cls.reschedule(cls._stop or (maxcount and counter > maxcount))</div><div>            counter += 1</div><div>    </div><div>    @classmethod</div><div>    def schedule(cls):</div><div>        if cls.schedule_channel.receive():</div>
<div>            raise TaskletExit </div><div>        </div><div>    @classmethod</div><div>    def reschedule(cls, stop = False):</div><div>        while cls.schedule_channel.balance < 0:</div><div>            cls.schedule_channel.send(stop)</div>
</div><div><br></div><div>Any help is appreciated ..</div><div><br></div><div>Lars</div><div><br></div><div><br></div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Sat, Nov 30, 2013 at 8:53 PM, Richard Tew <span dir="ltr"><<a href="mailto:richard.m.tew@gmail.com" target="_blank">richard.m.tew@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Lars :-)<br>
<br>
Yes, there is no documentation for stacklesslib yet.  To use it, you<br>
really need to be willing to read the source code.<br>
<br>
You should already know whether calling patch_all would be enough.  It<br>
would have been something you could have tried immediately, rather<br>
than asking the list and waiting.<br>
<br>
Cheers,<br>
Richard.<br>
<div><div class="h5"><br>
On 11/30/13, lars van Gemerden <<a href="mailto:lars@rational-it.com">lars@rational-it.com</a>> wrote:<br>
> Hi all,<br>
><br>
> I though i could avoid it to run my demo but it seems i need to let the<br>
> webserver (simple server?, single thread, 'bottle' micro framework) yield<br>
> to the scheduler i am using. I have downloaded stacklesslib 1.0.3, but<br>
> can't find any documentation to help with monkeypatching.<br>
><br>
> - Do i just run patch_all at the start of the program?<br>
><br>
> Any help is very welcome ..<br>
><br>
> Cheers, Lars<br>
><br>
> --<br>
> ====================================<br>
> Lars van Gemerden<br>
> <a href="mailto:lars@rational-it.com">lars@rational-it.com</a><br>
> <a href="tel:%2B31%206%2026%2088%2055%2039" value="+31626885539">+31 6 26 88 55 39</a><br>
> ====================================<br>
><br>
<br>
</div></div>_______________________________________________<br>
Stackless mailing list<br>
<a href="mailto:Stackless@stackless.com">Stackless@stackless.com</a><br>
<a href="http://www.stackless.com/mailman/listinfo/stackless" target="_blank">http://www.stackless.com/mailman/listinfo/stackless</a><br>
</blockquote></div><br><br clear="all"><div><br></div>-- <br>====================================<br>Lars van Gemerden<br><a href="mailto:lars@rational-it.com">lars@rational-it.com</a><br>+31 6 26 88 55 39<br>====================================
</div>