beansdoc

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Last revision Both sides next revision
beansdoc [2011/01/05 12:02]
hourdin Threshold doc
beansdoc [2011/06/21 17:26]
hourdin timers and delay
Line 81: Line 81:
  
 Example: a "{0} ms" ValueFormat value will emit a "12 ms" string for a Format(12) method invocation. Example: a "{0} ms" ValueFormat value will emit a "12 ms" string for a Format(12) method invocation.
 +
 +===== Beans managing time and threads =====
 +
 +==== Timer ====
 +The timer bean allows an event to be sent periodically. It creates a single thread that manages the loop. A sleep is done before each event sending, for the time defined by the **Period** property. It means that if the methods called by the event sending (if the event is linked to methods of other beans) take one second to execute, the actual time between two events will be 1s+Period. The [[beansdoc#​activetimer|ActiveTimer]] bean fixes this issue.
 +  * **^TimerTick**:​ the void event that is sent periodically.
 +  * **Start()**:​ this method is used to start the timer'​s loop once it has been created. It is also used to restart the loop once it has been stopped.
 +  * **Stop()**: stops the loop and thus event sending.
 +
 +==== ActiveTimer ====
 +This timer has the same goal than the [[beansdoc#​timer|Timer]] bean, but creates a new thread on each event sending. The main difference with [[beansdoc#​timer|Timer]] is thus that the time between two events is not affected by what's executed by the event in other beans.
 +It has the same interface than [[beansdoc#​timer|Timer]].
 +
 +==== Delay ====
 +This bean acts as a simple event delayer. It is a generic bean, meaning that it can handle any type of event in input and methods in output. When its **Input()** method is called, it will wait for a delay configured by the **DelayMillisec** property, and send the **^Output** event with the same arguments than the Input.
 +The method and event of this bean, and all other generic beans, won't appear in the compatible list when creating a link. It has to be searched in the incompatible list of methods.
  • beansdoc.txt
  • Last modified: 2011/06/21 18:08
  • by hourdin