discuss-gnuradio
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Discuss-gnuradio] Flow control with message ports


From: Michael Wentz
Subject: [Discuss-gnuradio] Flow control with message ports
Date: Tue, 8 Nov 2016 19:27:18 -0500

Hi,

I've made a block in Python that has one message port out and no other ports. What the block does is simple: read from a file, parse data into a dict, convert to a PMT, and publish as a message. The port is connected to a sync_block that is acting on these messages when it deems fit. My desired behavior is for the publisher to fill up the queue as fast as possible and block if the queue is full (waiting for room to open up). What I've observed is that the queue will instead overflow and messages will be dropped. Is there any way to have a blocking call to message_port_pub()? 

Looking through the code I do see a method in basic_block to get the number of messages in the queue, which I could use to decide to publish a message or not - but this isn't brought out in the SWIG interface. Is there a reason why? If not, I was thinking about re-defining the SWIG interface for basic_block in my OOT with additional methods, but was wondering if that would create conflicts/weird issues.

Any other ideas for how to do this would be appreciated. I realize I could parse the file in my sync_block, but that's my last resort here.

-Michael

reply via email to

[Prev in Thread] Current Thread [Next in Thread]