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 linki in parallel, returning as soon as any of them are ready to read from.

Details

  • The linki 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 linki 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.
  • If link has not been activated by LinkActivate or by successfully reading or writing data, then LinkReadyQ tests whether the other side of the link has been created.
  • The basic form of LinkReadyQ corresponds to the WSTP library function WSReady().

Examples

open allclose all

Basic Examples  (1)

Launch a subsidiary Wolfram Language kernel process:

LinkReadyQ will now report an expression waiting to be read:

Read the expression:

Now the link will be empty:

Close the link:

Scope  (1)

Use LinkReadyQ to determine whether an inactive link is ready to be activated:

Once the other side of the link has been established, the link is ready to be activated:

Wolfram Research (1996), LinkReadyQ, Wolfram Language function, https://reference.wolfram.com/language/ref/LinkReadyQ.html (updated 2007).

Text

Wolfram Research (1996), LinkReadyQ, Wolfram Language function, https://reference.wolfram.com/language/ref/LinkReadyQ.html (updated 2007).

CMS

Wolfram Language. 1996. "LinkReadyQ." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2007. https://reference.wolfram.com/language/ref/LinkReadyQ.html.

APA

Wolfram Language. (1996). LinkReadyQ. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/LinkReadyQ.html

BibTeX

@misc{reference.wolfram_2023_linkreadyq, author="Wolfram Research", title="{LinkReadyQ}", year="2007", howpublished="\url{https://reference.wolfram.com/language/ref/LinkReadyQ.html}", note=[Accessed: 19-March-2024 ]}

BibLaTeX

@online{reference.wolfram_2023_linkreadyq, organization={Wolfram Research}, title={LinkReadyQ}, year={2007}, url={https://reference.wolfram.com/language/ref/LinkReadyQ.html}, note=[Accessed: 19-March-2024 ]}