There is no "correct" behaviour, since this isn't defined by some specification
somewhere.
In C stackless, tasklets are linked together using their "next" attribute.
This is used to implement the runnable queue and also the queue for the
tasklets. The channel's "queue" slot simply holds a reference to the first
tasklet in the queue.
To get all the tasklets, use this:
def GetQueue(channel):
first = task = channel.queue
result = []
while task:
result.append(task)
task = task.next
if task is first: break
return result
I expect that the channels are differently implemented in PyPy, perhaps using a
Deque, so that is what queue returns for that implementation.
K
> -----Original Message-----
> From: [email protected] [mailto:stackless-
> [email protected]] On Behalf Of Andrew Francis
> Sent: 6. desember 2009 19:47
> To: [email protected]
> Subject: [Stackless] Question about Channel Queue attribute
>
> Hi Folks:
>
> I am using python 2.5.2 on Ubuntu 9.04...
>
> I noticed that channel.queue returns the head of the queue rather than
> the queue. I also looked at channel_get_queue() in channelObject.c. I
> have to admit, my C is a bit rusty but it looks like it returns the
> first object in the queue.
>
> In contrast, when I use Stackless.py, I get back a dequeue (this is the
> way it is implemented) which is what I would expect.
>
> What is the correct behaviour?
>
> Cheers,
> Andrew
>
>
>
>
>
>
>
>
>
>
>
> _______________________________________________
> Stackless mailing list
> [email protected]
> http://www.stackless.com/mailman/listinfo/stackless
_______________________________________________
Stackless mailing list
[email protected]
http://www.stackless.com/mailman/listinfo/stackless