control4 / docs-driverworks

Home Page for the Driverworks SDK
Other
41 stars 17 forks source link

Wait for Asynchronous Event #15

Closed mojtabavi closed 2 years ago

mojtabavi commented 2 years ago

Does the driverworks-api have any Wait for Asynchronous Event API? or any Asynchronous delay?

WWalshC4 commented 2 years ago

Several of the built-in commands have asyncronous operation from the perspective of Driverworks. The most commonly used ones are going to be the network IO libraries, which are either http(s) (using C4:Url) or network operations (which can use either the built in TCPClient / TCPServer modules, or the native Control4 network connection operations.

The timer commands also operate from an async perspective inside Driverworks, where the timer expiring triggers an async callback.

Input from the rest of the system (by watching events, variables, system variables etc) also triggers async callbacks inside the Driverworks environment.

What are you trying to achieve?

mojtabavi commented 2 years ago

I think using Timer is best idea for me tnx

WWalshC4 commented 2 years ago

I would recommend using the module we publish at https://github.com/control4/drivers-common-public/blob/master/global/timer.lua as the basis for any work you do with timers. Other modules inside that repository will be good demonstrators of how to use the timer module.

mojtabavi commented 2 years ago

thanks for your answer it realy helps me @WWalshC4 can i have your email? I have some question about driver developing