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.
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 all close allBasic Examples (1)
Launch a subsidiary Wolfram Language kernel process:
link = LinkLaunch["\"" <> First[$CommandLine] <> "\"" <> " -wstp"]LinkReadyQ will now report an expression waiting to be read:
LinkReadyQ[link]LinkRead[link]LinkReadyQ[link]LinkClose[link]Scope (1)
Use LinkReadyQ to determine whether an inactive link is ready to be activated:
listen = LinkCreate[];
LinkReadyQ[listen]Once the other side of the link has been established, the link is ready to be activated:
connect = LinkConnect[listen[[1]]];
LinkReadyQ[listen]LinkClose[listen];LinkClose[connect];Related Guides
History
Introduced in 1996 (3.0) | Updated in 2007 (6.0)
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_2026_linkreadyq, author="Wolfram Research", title="{LinkReadyQ}", year="2007", howpublished="\url{https://reference.wolfram.com/language/ref/LinkReadyQ.html}", note=[Accessed: 12-June-2026]}
BibLaTeX
@online{reference.wolfram_2026_linkreadyq, organization={Wolfram Research}, title={LinkReadyQ}, year={2007}, url={https://reference.wolfram.com/language/ref/LinkReadyQ.html}, note=[Accessed: 12-June-2026]}