S# Threading


 

Is there a way to run a method of a class in a separate thread in non-PRO S#?  The S# documentation says that the thread class is reserved for S# PRO.

Thanks in advance for the help

Jay


 
Змінено

Yes, you can. You have to use the .BeginInvoke() method.


 

Thanks!!

On 11/4/2024 2:59 PM, Crestron_Programmer via groups.io wrote:

[Edited Message Follows]

Yes, you can. You have to use the .BeginInvoke() method.


 

After banging my head against the wall looking at too many online examples that are related to windows UI programming.  Does anyone have a short code example of BeginInvoke with a parameter being passed to the routine that will be spawned in its own thread?

Thanks in advance for the help

Jay

On 11/4/2024 3:27 PM, jbasen via groups.io wrote:

Thanks!!

On 11/4/2024 2:59 PM, Crestron_Programmer via groups.io wrote:

[Edited Message Follows]

Yes, you can. You have to use the .BeginInvoke() method.


 

CrestronInvoke.BeginInvoke(parameter => { CrestronConsole.PrintLine("Doing whatever");});


 

Thanks so much!

On 11/5/2024 12:57 PM, Crestron_Programmer via groups.io wrote:

CrestronInvoke.BeginInvoke(parameter => { CrestronConsole.PrintLine("Doing whatever");});