.NET/Link API Version 1.7 USE FRAMES

IMathLink.Yield Event

Occurs periodically when the link is blocking in a reading call.

[Visual Basic]
Event Yield As YieldFunction
[C#]
event YieldFunction Yield;

Remarks

The Yield event is raised at unspecified intervals (but generally many times a second) while the link is blocked in a "Get" call waiting for data to arrive, or a "Put" call waiting for buffer space to free up inside MathLink.

In a single-threaded program, a handler for the Yield event can be used as a place to perform actions necessary to keep the program responsive (like calling Application.DoEvents()). For most programs, a better choice is to use multiple threads, so that your user interface thread is not blocked waiting for the result of a Mathematica computation.

The Yield handler is passed no arguments. It should return true or false to indicate whether to back out of the read call or not. Returning true means to back out, which will cause a MathLinkException to be thrown in the Get call that is currently blocked waiting for data.

See Also

IMathLink Interface | Wolfram.NETLink Namespace