Announcement

Collapse
No announcement yet.

How events pass control to other events

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • How events pass control to other events

    I'm sure I read the answer to this very simple question somewhere, but can't find it...
    If an event calls another event, does control return to the calling event after execution (like a subroutine), or is the calling event gone forever?


    Jim Speiser
    30-year veteran of Home Automation
    Still don't know squat

  • #2
    When an Event calls another Event, the called Event is spun off in a new thread while the calling Event continues its remaining Actions if there are any. There is no control handed off or returned in the process and the calling Event is not suspended, slowed down or cancelled. The two events remain autonomous with the calling Event becoming the Trigger of the called Event and the called Event has no relationship with the calling Event once it is started.
    Randy Prade
    Aurora, CO
    Prades.net

    PHLocation - Pushover - EasyTrigger - UltraECM3 - Ultra1Wire3 - Arduino

    Comment


    • #3
      I always appreciate rprade ''s Posts.
      This explains a lot now. I had always suspected it to be like a Gosub - Return, with subsequent processing on hold.
      But this sheds all new light on an old programmer. And that's good too, I like the multi thread processing.
      thanks Randy
      Blair

      HomeSeer: HS3 Pro 3.0.0.548
      Hometroller S6 | Devices: 832 | Events: 211
      Plug-Ins: Z-Wave .252 | HSTouch | RFXCOM | UltraRachio3 | Sonos
      BLLAN | BLPLEX | BLLOCK | NetCAM | Global Cache Pro | Blur-Iris4

      Comment


      • #4
        Originally posted by rprade View Post
        When an Event calls another Event, the called Event is spun off in a new thread while the calling Event continues its remaining Actions if there are any. There is no control handed off or returned in the process and the calling Event is not suspended, slowed down or cancelled. The two events remain autonomous with the calling Event becoming the Trigger of the called Event and the called Event has no relationship with the calling Event once it is started.
        I thought I remembered reading something like this. Thanks. I gather this means a "wait n secs" or "wait for completion" in the called event has no effect on the calling event, and/or vice/versa, yes/no?


        Jim Speiser
        30-year veteran of Home Automation
        Still don't know squat

        Comment


        • #5
          Originally posted by JimSpy View Post

          I thought I remembered reading something like this. Thanks. I gather this means a "wait n secs" or "wait for completion" in the called event has no effect on the calling event, and/or vice/versa, yes/no?
          Yes, the called Event has no effect on the timing of remaining actions in the calling Event. This is important to remember in some cases. For example if I have an Event that calls three more Events, each turning off 10 Z-Wave devices, this will result in 30 devices being controlled at essentially the same time. For that reason I will either add a Wait or use a Delayed Event action in some circumstances to minimize the chance of a flood of Z-Wave commands. Usually Z-Wave can handle it and HomeSeer has no problem doing than many things at once, but with Z-Wave latency i prefer to slow things down a bit. Now that Spud's Easy Trigger can send commands to a group of devices, allowing each command to have a delay and avoiding a command to a device that will not result in a change of status, I tend to use Easy Trigger group control to slow down the issuance of commands.
          Randy Prade
          Aurora, CO
          Prades.net

          PHLocation - Pushover - EasyTrigger - UltraECM3 - Ultra1Wire3 - Arduino

          Comment


          • #6
            Originally posted by rprade View Post
            Yes, the called Event has no effect on the timing of remaining actions in the calling Event. This is important to remember in some cases. For example if I have an Event that calls three more Events, each turning off 10 Z-Wave devices, this will result in 30 devices being controlled at essentially the same time. For that reason I will either add a Wait or use a Delayed Event action in some circumstances to minimize the chance of a flood of Z-Wave commands. Usually Z-Wave can handle it and HomeSeer has no problem doing than many things at once, but with Z-Wave latency i prefer to slow things down a bit. Now that Spud's Easy Trigger can send commands to a group of devices, allowing each command to have a delay and avoiding a command to a device that will not result in a change of status, I tend to use Easy Trigger group control to slow down the issuance of commands.
            Roger that. I know nothing of this Spud or his Easy Trigger, I assume it's a plug-in that I don't have, but I understand the concept.

            Thank you, and best of the holidays.


            Jim Speiser
            30-year veteran of Home Automation
            Still don't know squat

            Comment

            Working...
            X