Event Generators
Event Generators asynchronously emit events to be consumed by pipelines. At present, there is only the timer
generator, used to generate events on an interval or at startup.
Event Generators
EventGenerator
EventGenerator
Describes the configuration for an EventGenerator.
For an example of an EventGenerator, see timer
.
Referenced By:
EdgeConnectConfig RecipeDefinition
Fields
Name | Type | Description | Required |
---|---|---|---|
config | object | Configuration information for the particular type of EventGenerator used. Described in the documentation for each event generator type. | No |
type | string | The unique type of the EventGenerator. Example: "timer" | Yes |
Event Generator Types
timer
timer
The timer eventGenerator allows generation of periodic or oneshot timer events.
On a timer tick, a timer event will be output with the following keys:
{
"eventGenerator": "my-5s-ticker", (string)
"eventType": "5s-tick", (string)
"time": "2020-09-03T23:53:51.155076768Z", (time.Time)
"tickCount": 76, (int)
"interval": 5000000000, (time.Duration)
}
Output: eventMap
if defined, otherwise a timer event as described above
Fields
Name | Type | Description | Required |
---|---|---|---|
debug | boolean | Enable debug logging | No |
eventType | string | Timer event type Example: "my-timer-event" | Yes |
interval | positiveDuration ✅ templating | Timer tick interval (positive duration string) | Yes |
keyPairs | object ✅ templating ✅ dot notation | Key pairs to emit on timer tick event. Example: { "message": "Happy Birthday {{ Serial }}!", "type": "Birthday Card"} | No |
oneshot | boolean | Timer will ony fire one time, not repeatedly | No |
verbose | boolean | Enable verbose logging | No |
Example
{
"service": {
"eventGenerators": {
"exampleTimer": {
"config": {
"eventType": "heartbeat",
"interval": 1000000000,
"keyPairs": {
"timestamp": "{{ return Timestamp }}"
}
},
"type": "timer"
}
}
}
}
Updated over 1 year ago