Difference between revisions of "Core.setAutoYield"

From GiderosMobile
(Created page with "__NOTOC__ '''Available since:''' Gideros 2025.2<br/> '''Class:''' Core<br/> === Description === Auto yields the function running as background task. <syntaxhighlight lang...")
 
 
(One intermediate revision by the same user not shown)
Line 4: Line 4:
  
 
=== Description ===
 
=== Description ===
Auto yields the function running as background task.
+
When working with async calls, you'll sometimes want to control when your thread is auto yielding or not, because auto-yielding may happen in the middle of something that should never be interrupted.
 
<syntaxhighlight lang="lua">
 
<syntaxhighlight lang="lua">
 
Core.setAutoYield(auto)
 
Core.setAutoYield(auto)
Line 10: Line 10:
  
 
=== Parameters ===
 
=== Parameters ===
'''auto''': (boolean) enable/disable auto yield<br/>
+
'''auto''': (boolean) enable/disable autoyielding for the calling async call<br/>
  
 
{{Core}}
 
{{Core}}

Latest revision as of 23:54, 25 March 2025

Available since: Gideros 2025.2
Class: Core

Description

When working with async calls, you'll sometimes want to control when your thread is auto yielding or not, because auto-yielding may happen in the middle of something that should never be interrupted.

Core.setAutoYield(auto)

Parameters

auto: (boolean) enable/disable autoyielding for the calling async call