Difference between revisions of "Thread:getResults"

From GiderosMobile
(Created page with "__NOTOC__ <languages /> '''<translate>Available since</translate>:''' 2018.10<br/> '''<translate>Class</translate>:''' Thread<br/> === <translat...")
 
m (Text replacement - "</source>" to "</syntaxhighlight>")
 
(3 intermediate revisions by 2 users not shown)
Line 1: Line 1:
 
__NOTOC__
 
__NOTOC__
<languages />
+
'''Available since:''' 2018.10<br/>
'''<translate>Available since</translate>:''' 2018.10<br/>
+
'''Class:''' [[Thread]]<br/>
'''<translate>Class</translate>:''' [[Special:MyLanguage/Thread|Thread]]<br/>
+
 
 +
=== Description ===
 +
Gets any results from thread if finished now, or after waiting a supplied number of microseconds.
 +
<syntaxhighlight lang="lua">
 +
ok, ... = thread:getResults(wait_time)
 +
</syntaxhighlight>
  
=== <translate>Description</translate> ===
 
<translate>Get any results from thread if finished now, or after waiting a supplied number of microseconds.
 
<br/>
 
 
Also throws any runtime errors generated by a thread, call periodically to check.
 
Also throws any runtime errors generated by a thread, call periodically to check.
</translate><br/>
 
<source lang="lua">local ok, ... = thread:getResults(wait_time)</source>
 
  
=== <translate>Parameters</translate> ===
+
=== Parameters ===
'''wait_time: ''' ''(number)'' <translate>time in microseconds to wait for result if none available</translate><br/>
+
'''wait_time: ''' ''(number)'' time in microseconds to wait for result if none available<br/>
=== <translate>Return values</translate> ===
+
 
'''ok: ''' ''(boolean)'' <translate>success</translate><br/>
+
=== Return values ===
'''...: ''' ''(misc)'' <translate>any number of returned variables</translate><br/>
+
'''ok: ''' ''(boolean)'' success<br/>
 +
'''...: ''' ''(misc)'' any number of returned variables<br/>
 +
 
 +
{{Thread}}

Latest revision as of 14:33, 13 July 2023

Available since: 2018.10
Class: Thread

Description

Gets any results from thread if finished now, or after waiting a supplied number of microseconds.

ok, ... = thread:getResults(wait_time)

Also throws any runtime errors generated by a thread, call periodically to check.

Parameters

wait_time: (number) time in microseconds to wait for result if none available

Return values

ok: (boolean) success
...: (misc) any number of returned variables