# Message passing - issue with messages left in queues after running top block

**URL:** <https://www.ruby-forum.com/t/message-passing-issue-with-messages-left-in-queues-after-running-top-block/231120>\
**Category:** GNU Radio\
**Created:** [July 22, 2014, 2:45pm UTC](https://www.ruby-forum.com/t/message-passing-issue-with-messages-left-in-queues-after-running-top-block/231120 "2014-07-22T14:45:52Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![addis\_a](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/c4cdca/32.png) [@addis\_a](https://www.ruby-forum.com/u/addis_a)\
**Post date:** [July 22, 2014, 2:45pm UTC](https://www.ruby-forum.com/t/message-passing-issue-with-messages-left-in-queues-after-running-top-block/231120/1 "2014-07-22T14:45:52Z")

</div>

Hi all,

I’ve noticed that “Run to completion” works now in situation when  
message passing is used, which is great!  
I have a related question. I’m creating a block which uses message  
passing, and run it once:

```
    tb = some_block(fname="file1")
    tb.start()
    tb.wait()

```

#at this moment tb has still some unprocessed messages in message queues  
#so if I run the block again on another file …

```
    tb.set_fname("file2")
    tb.start()
    tb.wait()

```

I can see messages that were result of processing of file1. Do you know  
how to avoid this?  
One of acceptable solutions can be flushing msg queues after processing  
of file1, but I don’t know how to achieve this.

Best Regards,  
Piotr K.

---

<div class="post-metadata">

**Author:** ![Perper](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/e79b87/32.png) [@Perper](https://www.ruby-forum.com/u/Perper)\
**Post date:** [July 23, 2014, 3:50pm UTC](https://www.ruby-forum.com/t/message-passing-issue-with-messages-left-in-queues-after-running-top-block/231120/2 "2014-07-23T15:50:24Z")

</div>

On Tue, Jul 22, 2014 at 8:44 AM, Perper [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> One of acceptable solutions can be flushing msg queues after processing  
> of file1, but I don’t know how to achieve this.
> 
> Best Regards,  
> Piotr K.

There are still a couple of issues with the message passing, obviously.  
The  
proper shutdown of graphs is definitely on our list of things to deal  
with.  
We hope to have improvements that cover issues like this by the release  
of  
3.7.5.

Tom
