github.com/lmorg/murex@v0.0.0-20240217211045-e081c89cd4ef/docs/events/onsecondselapsed.md (about)

     1  # `onSecondsElapsed`
     2  
     3  > Events triggered by time intervals
     4  
     5  ## Description
     6  
     7  `onSecondsElapsed` events are triggered every _n_ seconds.
     8  
     9  ## Usage
    10  
    11  ```
    12  event onSecondsElapsed name=seconds { code block }
    13  
    14  !event onSecondsElapsed name
    15  ```
    16  
    17  ## Valid Interrupts
    18  
    19  * `<seconds>`
    20      Duration in seconds. eg `60` would be 60 seconds / 1 minute
    21  
    22  ## Payload
    23  
    24  The following payload is passed to the function via STDIN:
    25  
    26  ```
    27  {
    28      "Name": "",
    29      "Interrupt": 0
    30  }
    31  ```
    32  
    33  ### Name
    34  
    35  This is the name you specified when defining the event.
    36  
    37  ### Interrupt
    38  
    39  This is the duration you defined the event to wait for.
    40  
    41  ## Examples
    42  
    43  ```
    44  event onSecondsElapsed example=60 {
    45      out "60 seconds has passed"
    46  }
    47  ```
    48  
    49  ## See Also
    50  
    51  * [`config`](../commands/config.md):
    52    Query or define Murex runtime settings
    53  * [`event`](../commands/event.md):
    54    Event driven programming for shell scripts
    55  
    56  <hr/>
    57  
    58  This document was generated from [builtins/events/onSecondsElapsed/onsecondselapsed_doc.yaml](https://github.com/lmorg/murex/blob/master/builtins/events/onSecondsElapsed/onsecondselapsed_doc.yaml).