[Pharo-project] [COTDC] 18 - SMxMorphicAlarm
Today: SMxMorphicAlarm Comment Of The Day Contest - One Day One Comment Rules: #1: Each day a not commented class is elected. Each day the best comment will be integrated with name of the author(s). #2: If you cannot comment it, deprecate it. Results: http://code.google.com/p/pharo/wiki/CommentOfTheDayContest Laurent
I'm the exact duplicate of MorphicAlarm in the Simple Morphic world. I represent a special message sent at some time for some morphic purpose as managed by the morphic world state. Noury On 23 févr. 2011, at 20:07, laurent laffont wrote:
Today: SMxMorphicAlarm
Comment Of The Day Contest - One Day One Comment Rules: #1: Each day a not commented class is elected. Each day the best comment will be integrated with name of the author(s). #2: If you cannot comment it, deprecate it. Results: http://code.google.com/p/pharo/wiki/CommentOfTheDayContest
Laurent
Noury Bouraqadi http://car.mines-douai.fr/noury -- -6th National Conference on âControl Architecture of Robotsâ 24-25 may 2011, Grenoble area, France http://car2011.inrialpes.fr/ -19th ESUG International Smalltalk Conference 22-26 August 2011, Edinburgh, UK http://www.esug.org/Conferences/2011
Finally a funny class ;) I rephrase a little: I represent a message sent to be scheduled by the SMxWorldState. I'm the exact duplicate of MorphicAlarm in the Simple Morphic world (see MorphicAlarm comment). And in MorphicAlarm: I represent a message to be scheduled by the WorldState. For example, you can see me in action with the following example which print 'alarm test' on Transcript one second after evaluating the code: Transcript open. MorphicUIManager currentWorld addAlarm: #show: withArguments: #('alarm test') for: Transcript at: (Time millisecondClockValue + 1000). I haven't been able to test the previous code in SimpleMorphic, there's a MNU when trying to write in the Workspace. Laurent On Wed, Feb 23, 2011 at 9:28 PM, Noury Bouraqadi <bouraqadi@gmail.com>wrote:
I'm the exact duplicate of MorphicAlarm in the Simple Morphic world. I represent a special message sent at some time for some morphic purpose as managed by the morphic world state.
Noury
On 23 févr. 2011, at 20:07, laurent laffont wrote:
Today: SMxMorphicAlarm
Comment Of The Day Contest - One Day One Comment Rules: #1: Each day a not commented class is elected. Each day the best comment will be integrated with name of the author(s). #2: If you cannot comment it, deprecate it. Results: http://code.google.com/p/pharo/wiki/CommentOfTheDayContest
Laurent
Noury Bouraqadi http://car.mines-douai.fr/noury -- -6th National Conference on âControl Architecture of Robotsâ 24-25 may 2011, Grenoble area, France http://car2011.inrialpes.fr/
-19th ESUG International Smalltalk Conference 22-26 August 2011, Edinburgh, UK http://www.esug.org/Conferences/2011
On Feb 24, 2011, at 8:49 46PM, laurent laffont wrote:
Finally a funny class ;)
I rephrase a little:
I represent a message sent to be scheduled by the SMxWorldState. I'm the exact duplicate of MorphicAlarm in the Simple Morphic world (see MorphicAlarm comment).
And in MorphicAlarm:
I represent a message to be scheduled by the WorldState.
For example, you can see me in action with the following example which print 'alarm test' on Transcript one second after evaluating the code:
Transcript open. MorphicUIManager currentWorld addAlarm: #show: withArguments: #('alarm test') for: Transcript at: (Time millisecondClockValue + 1000).
I haven't been able to test the previous code in SimpleMorphic, there's a MNU when trying to write in the Workspace.
Laurent
For those wondering "why not just use normal delays and threading system?", you might want to add: "Compared to doing: [(Delay forMilliseconds: 1000) wait. Transcript show: 'alarm test'] forkAt: Processor activeProcess priority +1. the alarm system has 2 distinctions: - Runs with the step refresh rate resolution. - Alarms only run for the active world. (Unless a non-standard scheduler is in use) - Alarms with the same scheduled time are guaranteed to be executed in the order they were added" At least that's what I could reckon. Cheers, Henry
Laurent Laffont - @lolgzs <http://twitter.com/#!/lolgzs> Pharo Smalltalk Screencasts: http://www.pharocasts.com/ Blog: http://magaloma.blogspot.com/ On Fri, Feb 25, 2011 at 12:08 PM, Henrik Johansen < henrik.s.johansen@veloxit.no> wrote:
On Feb 24, 2011, at 8:49 46PM, laurent laffont wrote:
Finally a funny class ;)
I rephrase a little:
I represent a message sent to be scheduled by the SMxWorldState. I'm the exact duplicate of MorphicAlarm in the Simple Morphic world (see MorphicAlarm comment).
And in MorphicAlarm:
I represent a message to be scheduled by the WorldState.
For example, you can see me in action with the following example which print 'alarm test' on Transcript one second after evaluating the code:
Transcript open. MorphicUIManager currentWorld addAlarm: #show: withArguments: #('alarm test') for: Transcript at: (Time millisecondClockValue + 1000).
I haven't been able to test the previous code in SimpleMorphic, there's a MNU when trying to write in the Workspace.
Laurent
For those wondering "why not just use normal delays and threading system?", you might want to add: "Compared to doing: [(Delay forMilliseconds: 1000) wait. Transcript show: 'alarm test'] forkAt: Processor activeProcess priority +1.
the alarm system has 2 distinctions: - Runs with the step refresh rate resolution. - Alarms only run for the active world. (Unless a non-standard scheduler is in use) - Alarms with the same scheduled time are guaranteed to be executed in the order they were added"
At least that's what I could reckon.
Added, thanks Henrik. It's cool to learn. Laurent
Cheers, Henry
participants (4)
-
Henrik Johansen -
laurent laffont -
Noury Bouraqadi -
Stéphane Ducasse