LinkReadyQ

LinkReadyQ[link]
tests whether there is an expression ready to read from the specified WSTP connection.

LinkReadyQ[link,t]
waits for up to t seconds to see if an expression becomes ready to read.

LinkReadyQ[{link1,link2,},t]
tests all the in parallel, returning as soon as any of them are ready to read from.

DetailsDetails

  • The must be active LinkObject objects, as returned by functions like LinkLaunch or Links.
  • LinkReadyQ[{link1,link2,},t] returns a list of True and False, specifying which of the are ready to read from.
  • If LinkReadyQ[link] returns True, then LinkRead[link] will not block under any normal circumstances.
  • If LinkReadyQ[link] returns False, then LinkRead[link] will block, and will not return until something becomes available to read on link.
  • LinkReadyQ[link] tests whether there is any data to read; it cannot determine whether the data represents a complete expression.
  • The basic form of LinkReadyQ corresponds to the WSTP library function WLReady().

ExamplesExamplesopen allclose all

Basic Examples  (1)Basic Examples  (1)

Launch a subsidiary Wolfram Language kernel process:

In[1]:=
Click for copyable input
Out[1]=

Test whether there is an expression ready to be read:

In[2]:=
Click for copyable input
Out[2]=

Read the expression:

In[3]:=
Click for copyable input
Out[3]=

Close the link:

In[4]:=
Click for copyable input
Introduced in 1996
(3.0)
| Updated in 2007
(6.0)