# Terminating flowgraph inside

**URL:** <https://www.ruby-forum.com/t/terminating-flowgraph-inside/241811>\
**Category:** GNU Radio\
**Created:** [May 3, 2015, 4:12pm UTC](https://www.ruby-forum.com/t/terminating-flowgraph-inside/241811 "2015-05-03T16:12:41Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Detlef\_R](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/58f4c7/32.png) [@Detlef\_R](https://www.ruby-forum.com/u/Detlef_R)\
**Post date:** [May 3, 2015, 4:12pm UTC](https://www.ruby-forum.com/t/terminating-flowgraph-inside/241811/1 "2015-05-03T16:12:41Z")

</div>

Hello again,

is there any way that block inside a flowgraph terminate that flowgraph  
should stop. Something like when source block returns -1 from work  
function.  
What happens when arbitrary block in the middle of the flowgraph returns  
-1?

---

<div class="post-metadata">

**Author:** ![Nemanja\_S](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/n/7bcc69/32.png) [@Nemanja\_S](https://www.ruby-forum.com/u/Nemanja_S)\
**Post date:** [May 4, 2015, 9:05am UTC](https://www.ruby-forum.com/t/terminating-flowgraph-inside/241811/2 "2015-05-04T09:05:43Z")

</div>

Hi Nemanja,

> What happens when arbitrary block in the middle of the flowgraph  
> returns -1?  
> That block is set to the DONE state. After that, all output that still  
> can be processed is processed, successively setting the downstream  
> blocks to an “don’t call me, there can be no input” state.  
> After that, the top\_block.wait() call returns.

You probably want to have a look at Tom’s presentation linked in[1].

> is there any way that block inside a flowgraph terminate that  
> flowgraph should stop.  
> Well, returning WORK\_DONE==-1, but you’ve already figured that out, so  
> my guess is you want something else; would you mind elaborating on your  
> problem?

Best regards,  
Marcus

[1]

> **[Explaining the GNU Radio Scheduler — Rondeau Research](http://www.trondeau.com/blog/2013/9/15/explaining-the-gnu-radio-scheduler.html)**
>
> The most important and distinguishing piece of GNU Radio is the underlying scheduler and framework for implementing and connecting the signal processing blocks. While there are many other libraries of DSP blocks available, it's GNU Radio's scheduler...

---

<div class="post-metadata">

**Author:** ![Nemanja\_S](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/n/7bcc69/32.png) [@Nemanja\_S](https://www.ruby-forum.com/u/Nemanja_S)\
**Post date:** [May 4, 2015, 12:33pm UTC](https://www.ruby-forum.com/t/terminating-flowgraph-inside/241811/3 "2015-05-04T12:33:42Z")

</div>

* * *

Discuss-gnuradio mailing list  
removed\_email\_address@domain.invalid  
[https://lists.gnu.org/mailman/listinfo/discuss-gnuradio](https://lists.gnu.org/mailman/listinfo/discuss-gnuradio)
