gnuradio/gnuradio — pull request #178 by balint256 (2014-03-27 18:40:51+00:00)
Title: runtime: added blocking message pub'ing in basic_block

(made relevant scheduler changes so 'work' is called for message-port-only blocks), added 'pop_msg_queue' and 'post_msg' to Python block via block gateway

A blocking message queue is created by passing 'true' in the second parameter of 'message_port_register_in'. Any caller posting to that queue will block if the queue is not empty (this mechanism can be used to provide back-pressure in a network comms setup, for instance).

The idea is that such message-port-only blocks (without normal 'stream' IO ports) will use the work function to *optionally* pop messages from their queue (instead of registering a message handler that would always automatically service all pending messages).

The new Python functions allow Python blocks to post messages in a potentially blocking fashion, but release the Python GIL so the entire app doesn't freeze, as well as *optionally* popping a message from a queue in the Pythonic block's 'work' function.