break out of task

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

break out of task

NorbertHartl
Hi,

how is WATask supposed to be used? There is an endless
loop calling go on a task. How can I signal that this
task is "finished"? I would have expected a self answer
will do but it doesn't.

thanks,

Norbert

_______________________________________________
Seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

Re: break out of task

Lukas Renggli
> how is WATask supposed to be used? There is an endless
> loop calling go on a task. How can I signal that this
> task is "finished"? I would have expected a self answer
> will do but it doesn't.

WATask answers what your method #go is returning, which is self if you
don't specify anything else. However if there is nobody that calls the
task, it is simply restarted.

What would you expect otherwise? To get an empty component?

Lukas

--
Lukas Renggli
http://www.lukas-renggli.ch
_______________________________________________
Seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

Re: break out of task

NorbertHartl
On Mon, 2007-07-09 at 10:03 +0200, Lukas Renggli wrote:
> > how is WATask supposed to be used? There is an endless
> > loop calling go on a task. How can I signal that this
> > task is "finished"? I would have expected a self answer
> > will do but it doesn't.
>
> WATask answers what your method #go is returning, which is self if you
> don't specify anything else. However if there is nobody that calls the
> task, it is simply restarted.
>
Ok, now I know that I have to do a call: on the task. This not how
my logic works. It would expect the task to just return and the
following statements set up new components to show.

> What would you expect otherwise? To get an empty component?

In general I would expect the task to end. I understand a task as
"do these things and then you are finished so exit". The place
where the task was could be nil then and it would displayed nothing
(as long as this would work). In my case I just set up components
in the background which will show automatically as soon as the task
exits.

Or I would expect to work like normal WAComponents. If I'm not wrong
they render themselves as long as no answer is called. But if it is
called they return. So this could also be true for a WATask.

Norbert


_______________________________________________
Seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

Re: break out of task

Lukas Renggli
> > WATask answers what your method #go is returning, which is self if you
> > don't specify anything else. However if there is nobody that calls the
> > task, it is simply restarted.
>
> Ok, now I know that I have to do a call: on the task. This not how
> my logic works. It would expect the task to just return and the
> following statements set up new components to show.

A task expects you to override #go and do a #call: somewhere in there.
Otherwise a task doesn't make much sense. See the class comment.

> > What would you expect otherwise? To get an empty component?
>
> In general I would expect the task to end. I understand a task as
> "do these things and then you are finished so exit". The place
> where the task was could be nil then and it would displayed nothing
> (as long as this would work). In my case I just set up components
> in the background which will show automatically as soon as the task
> exits.

That should be  a last step of your task then.

> Or I would expect to work like normal WAComponents. If I'm not wrong
> they render themselves as long as no answer is called.

A WATask also answers when the method #go ends.

Lukass

--
Lukas Renggli
http://www.lukas-renggli.ch
_______________________________________________
Seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside