Waiting object

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

Waiting object

laura
Hi all,

I need an object/method like this one

Waiting>> wait : seconds
"i take the flow control during 'seconds' without halting image morphs stepping/handling (as Delay>>wait: does) and then return to the sender "

How can i implement it?
Where can i borrow for reuse an existing one from?


Best,
Laura
Reply | Threaded
Open this post in threaded view
|

Re: Waiting object

Nicolai Hess

2015-01-27 19:46 GMT+01:00 Laura Risani <[hidden email]>:
Hi all,

I need an object/method like this one

Waiting>> wait : seconds
"i take the flow control during 'seconds' without halting image morphs stepping/handling (as Delay>>wait: does) and then return to the sender "

Hi Laura,

Delay>>wait:
it just halts the image UI (morphs, display update, etc), if you call it from the active UI process.

If you want to use "wait", you need to tell "what" should wait.
You may create your own Process with #fork.  ["your code here"] fork.

For example.
Transcript open.
[
    10 timesRepeat:[Transcript crShow:(DateAndTime now).
        (Delay forSeconds:1) wait]
] fork.



 

How can i implement it?
Where can i borrow for reuse an existing one from?


Best,
Laura

Reply | Threaded
Open this post in threaded view
|

Re: Waiting object

Clément Béra
Hello,

Or simpler:

1 second wait.

In your example:

Transcript open.
[
    10 timesRepeat:[Transcript crShow:(DateAndTime now). 
        1 second wait]
] fork.


2015-01-27 20:21 GMT+01:00 Nicolai Hess <[hidden email]>:

2015-01-27 19:46 GMT+01:00 Laura Risani <[hidden email]>:
Hi all,

I need an object/method like this one

Waiting>> wait : seconds
"i take the flow control during 'seconds' without halting image morphs stepping/handling (as Delay>>wait: does) and then return to the sender "

Hi Laura,

Delay>>wait:
it just halts the image UI (morphs, display update, etc), if you call it from the active UI process.

If you want to use "wait", you need to tell "what" should wait.
You may create your own Process with #fork.  ["your code here"] fork.

For example.
Transcript open.
[
    10 timesRepeat:[Transcript crShow:(DateAndTime now).
        (Delay forSeconds:1) wait]
] fork.



 

How can i implement it?
Where can i borrow for reuse an existing one from?


Best,
Laura


Reply | Threaded
Open this post in threaded view
|

Re: Waiting object

Luc Fabresse
In reply to this post by Nicolai Hess
Hi Laura,

You can also use:

1 second wait.
2 seconds wait.

I particularly like these kind of writings ;-)

Cheers,

#Luc

2015-01-27 20:21 GMT+01:00 Nicolai Hess <[hidden email]>:

2015-01-27 19:46 GMT+01:00 Laura Risani <[hidden email]>:
Hi all,

I need an object/method like this one

Waiting>> wait : seconds
"i take the flow control during 'seconds' without halting image morphs stepping/handling (as Delay>>wait: does) and then return to the sender "

Hi Laura,

Delay>>wait:
it just halts the image UI (morphs, display update, etc), if you call it from the active UI process.

If you want to use "wait", you need to tell "what" should wait.
You may create your own Process with #fork.  ["your code here"] fork.

For example.
Transcript open.
[
    10 timesRepeat:[Transcript crShow:(DateAndTime now).
        (Delay forSeconds:1) wait]
] fork.



 

How can i implement it?
Where can i borrow for reuse an existing one from?


Best,
Laura


Reply | Threaded
Open this post in threaded view
|

Re: Waiting object

laura
In reply to this post by laura
Hi all,
Thank you for your answers.

But i yet can't see how to implement the method i wanted, because #fork schedules the process and immediately returns but i'd like to wait and only then return the answer.


Best,
Laura

On Tue, Jan 27, 2015 at 3:46 PM, Laura Risani <[hidden email]> wrote:
Hi all,

I need an object/method like this one

Waiting>> wait : seconds
"i take the flow control during 'seconds' without halting image morphs stepping/handling (as Delay>>wait: does) and then return to the sender "

How can i implement it?
Where can i borrow for reuse an existing one from?


Best,
Laura

Reply | Threaded
Open this post in threaded view
|

Re: Waiting object

Ben Coman
Hi Laura, Can you provide some more context by pasting code for how you expect both your UI and calculation methods to interact? What is the application?

cheers -ben

On Wed, Jan 28, 2015 at 5:49 AM, Laura Risani <[hidden email]> wrote:
Hi all,
Thank you for your answers.

But i yet can't see how to implement the method i wanted, because #fork schedules the process and immediately returns but i'd like to wait and only then return the answer.


Best,
Laura

On Tue, Jan 27, 2015 at 3:46 PM, Laura Risani <[hidden email]> wrote:
Hi all,

I need an object/method like this one

Waiting>> wait : seconds
"i take the flow control during 'seconds' without halting image morphs stepping/handling (as Delay>>wait: does) and then return to the sender "

How can i implement it?
Where can i borrow for reuse an existing one from?


Best,
Laura


Reply | Threaded
Open this post in threaded view
|

Re: Waiting object

laura
Hi Ben ,
#fork let me implement the overall functionality i wanted, but i had to introduce some minor changes into the design to reflect the concurrent nature of the msg. So i still feel curious about how one could implement this msg

Waiting>> wait : seconds
"i take the flow control during 'seconds' without halting image morphs and only then return to the sender "

Best,
Laura

On Tue, Jan 27, 2015 at 7:00 PM, Ben Coman <[hidden email]> wrote:
Hi Laura, Can you provide some more context by pasting code for how you expect both your UI and calculation methods to interact? What is the application?

cheers -ben

On Wed, Jan 28, 2015 at 5:49 AM, Laura Risani <[hidden email]> wrote:
Hi all,
Thank you for your answers.

But i yet can't see how to implement the method i wanted, because #fork schedules the process and immediately returns but i'd like to wait and only then return the answer.


Best,
Laura

On Tue, Jan 27, 2015 at 3:46 PM, Laura Risani <[hidden email]> wrote:
Hi all,

I need an object/method like this one

Waiting>> wait : seconds
"i take the flow control during 'seconds' without halting image morphs stepping/handling (as Delay>>wait: does) and then return to the sender "

How can i implement it?
Where can i borrow for reuse an existing one from?


Best,
Laura



Reply | Threaded
Open this post in threaded view
|

Re: Waiting object

Ben Coman


On Wed, Jan 28, 2015 at 11:31 PM, Laura Risani <[hidden email]> wrote:
Hi Ben ,
#fork let me implement the overall functionality i wanted, but i had to introduce some minor changes into the design to reflect the concurrent nature of the msg. So i still feel curious about how one could implement this msg

Waiting>> wait : seconds
"i take the flow control during 'seconds' without halting image morphs and only then return to the sender "

There is only one Morphic UI loop process which repetitively cycles for Morph stepping and the main interactive UI.  Use "Tools > Process Browser" to take a look at that process (priority=40) and its stack and you'll WorldMorph>>doOnceCycle.  If you are curious, you can put a "self haltOnce" in that method and invoke it using  "System > Enable halt/inspect once" and it will spawn that fault in that cycle off to another process you can trace through, while the main process continues to cycle.

However if you perform a non-concurrent #wait or busy calculation, then the UI loop is prevented from looping at its usual speed (see #interCyclePause).

cheers -ben
 

Best,
Laura

On Tue, Jan 27, 2015 at 7:00 PM, Ben Coman <[hidden email]> wrote:
Hi Laura, Can you provide some more context by pasting code for how you expect both your UI and calculation methods to interact? What is the application?

cheers -ben

On Wed, Jan 28, 2015 at 5:49 AM, Laura Risani <[hidden email]> wrote:
Hi all,
Thank you for your answers.

But i yet can't see how to implement the method i wanted, because #fork schedules the process and immediately returns but i'd like to wait and only then return the answer.


Best,
Laura

On Tue, Jan 27, 2015 at 3:46 PM, Laura Risani <[hidden email]> wrote:
Hi all,

I need an object/method like this one

Waiting>> wait : seconds
"i take the flow control during 'seconds' without halting image morphs stepping/handling (as Delay>>wait: does) and then return to the sender "

How can i implement it?
Where can i borrow for reuse an existing one from?


Best,
Laura




Reply | Threaded
Open this post in threaded view
|

Re: Waiting object

laura
Thank you Ben, i will take a look at that loop process.

On Wed, Jan 28, 2015 at 1:49 PM, Ben Coman <[hidden email]> wrote:


On Wed, Jan 28, 2015 at 11:31 PM, Laura Risani <[hidden email]> wrote:
Hi Ben ,
#fork let me implement the overall functionality i wanted, but i had to introduce some minor changes into the design to reflect the concurrent nature of the msg. So i still feel curious about how one could implement this msg

Waiting>> wait : seconds
"i take the flow control during 'seconds' without halting image morphs and only then return to the sender "

There is only one Morphic UI loop process which repetitively cycles for Morph stepping and the main interactive UI.  Use "Tools > Process Browser" to take a look at that process (priority=40) and its stack and you'll WorldMorph>>doOnceCycle.  If you are curious, you can put a "self haltOnce" in that method and invoke it using  "System > Enable halt/inspect once" and it will spawn that fault in that cycle off to another process you can trace through, while the main process continues to cycle.

However if you perform a non-concurrent #wait or busy calculation, then the UI loop is prevented from looping at its usual speed (see #interCyclePause).

cheers -ben
 

Best,
Laura

On Tue, Jan 27, 2015 at 7:00 PM, Ben Coman <[hidden email]> wrote:
Hi Laura, Can you provide some more context by pasting code for how you expect both your UI and calculation methods to interact? What is the application?

cheers -ben

On Wed, Jan 28, 2015 at 5:49 AM, Laura Risani <[hidden email]> wrote:
Hi all,
Thank you for your answers.

But i yet can't see how to implement the method i wanted, because #fork schedules the process and immediately returns but i'd like to wait and only then return the answer.


Best,
Laura

On Tue, Jan 27, 2015 at 3:46 PM, Laura Risani <[hidden email]> wrote:
Hi all,

I need an object/method like this one

Waiting>> wait : seconds
"i take the flow control during 'seconds' without halting image morphs stepping/handling (as Delay>>wait: does) and then return to the sender "

How can i implement it?
Where can i borrow for reuse an existing one from?


Best,
Laura