Utilities for easier integration with Owlkettle.
Procs
proc createListenerEvent[State: WidgetState](hub: ChannelHub; stateType: typedesc[State]; threadName: static string; sleepMs: int = 5): ApplicationEvent
-
Creates an Owlkettle.ApplicationEvent that registers a global timeout with owlkettle. Owlkettle executes these events when the owlkettle application starts.
The global timeout checks for and routes new messages every sleepMs for the threadName threadServer on hub.
The handler-proc for that message type then gets executed with the message, hub and owlkettle's root widget's WidgetState stateType.
Source Edit