arokem / python-matlab-bridge

A simple Python => MATLAB(R) interface and a matlab_magic for ipython
BSD 2-Clause "Simplified" License
332 stars 97 forks source link

Make implicit non-blocking calls explicitly blocking #260

Open lrq3000 opened 5 years ago

lrq3000 commented 5 years ago

There is an implicit behavior where calls to Matlab functions with no output arguments are non-blocking, and calls to Matlab functions witth output arguments are blocking.

This is in general fine but some functions with no output arguments are meant to be blocking (eg, functions that asks for user some input or to show a visualization for user to check). Currently, the only way to make such a call blocking is to change the Matlab function to return an argument.

Adding an optional argument to run_func() such as blocking=True that would make the call blocking in any case regardless of output arguments would solve this issue.