title: GNU Radio buffer size
body: <p>How can I set custom buffer size for OOT python block in GNU Radio? My goal is block with input parameter input_buffer_len and block's geeral_work() function works with exactly input_buffer_len samples.
  input_buffer_len = 1360 <br>
  My code so far: <br></p>
  <pre><code>import numpy as np
  from gnuradio import gr
     def __init(self, input_buffer_len):
        gr.basic_block.__init__(self,
           name=&quot;sync_test&quot;,
           in_sig=[np.uint8],
           out_sig=[np.uint8])
        self.input_buffer_len = input_buffer_len
  
     def forecast(self, noutput_items, ninput_items_required):
        print(&quot;FORECAST START&quot;)
        ninput_items_required[0] = self.input_buffer_len
        print(&quot;len(ninput_items_required),noutput_items&quot;,len(ninput_items_required),noutput_items)
        print(&quot;FORECAST END&quot;)
  
     def general_work(self, input_items, output_items):
        print(&quot;GENERAL WORK START&quot;)
        print(&quot;len(input_items)&quot;, len(input_items[0]))
        print(&quot;len(output_items)&quot;, len(output_items[0]))
        output_items[0][0:self.input_buffer_len] = input_items[0][0:self.input_buffer_len]
        self.produce(0, self.input_buffer_len)
        self.consume(0, self.input_buffer_len)
        print(&quot;GENERAL WORK END&quot;)
        return 0
  </code></pre>
  <p>Output:</p>
  <pre><code>FORECAST START
  len(ninput_items_required),noutput_items 1 32768
  FORECAST END
  FORECAST START
  len(ninput_items_required),noutput_items 1 16384
  FORECAST END
  FORECAST START
  len(ninput_items_required),noutput_items 1 8192
  FORECAST END
  FORECAST START
  len(ninput_items_required),noutput_items 1 4096
  FORECAST END
  FORECAST START
  len(ninput_items_required),noutput_items 1 2048
  FORECAST END
  FORECAST START
  len(ninput_items_required),noutput_items 1 1024
  FORECAST END
  FORECAST START
  len(ninput_items_required),noutput_items 1 512
  FORECAST END
  FORECAST START
  len(ninput_items_required),noutput_items 1 256
  FORECAST END
  FORECAST START
  len(ninput_items_required),noutput_items 1 128
  FORECAST END
  FORECAST START
  len(ninput_items_required),noutput_items 1 64
  FORECAST END
  FORECAST START
  len(ninput_items_required),noutput_items 1 32
  FORECAST END
  FORECAST START
  len(ninput_items_required),noutput_items 1 16
  FORECAST END
  FORECAST START
  len(ninput_items_required),noutput_items 1 8
  FORECAST END
  FORECAST START
  len(ninput_items_required),noutput_items 1 4
  FORECAST END
  FORECAST START
  len(ninput_items_required),noutput_items 1 2
  FORECAST END
  FORECAST START
  len(ninput_items_required),noutput_items 1 1
  FORECAST END
  FORECAST START
  len(ninput_items_required),noutput_items 1 32768
  FORECAST END
  GENERAL WORK START
  len(input_items) 32895
  len(output_items) 32768
  GENERAL WORK END
  FORECAST START
  len(ninput_items_required),noutput_items 1 32768
  FORECAST END
  GENERAL WORK START
  len(input_items) 30175
  len(output_items) 32768
  GENERAL WORK END
  FORECAST START
  len(ninput_items_required),noutput_items 1 32768
  FORECAST END
  GENERAL WORK START
  len(input_items) 27455
  len(output_items) 32768
  GENERAL WORK END
  FORECAST START
  len(ninput_items_required),noutput_items 1 32768
  FORECAST END
  GENERAL WORK START
  len(input_items) 26095
  len(output_items) 32768
  GENERAL WORK END
  FORECAST START
  len(ninput_items_required),noutput_items 1 32768
  FORECAST END
  GENERAL WORK START
  len(input_items) 24735
  len(output_items) 32768
  GENERAL WORK END
  ...
  GENERAL WORK END
  </code></pre>
  <p>It looks like input_items keeps decreasing by input_buffer_len every general_work() call and output_items stays at 32768, does that mean GNU Radio works with input_buffer_len elements every general work()? Or am I misunderstanding something? Im using GNU Radio V3.8.2</p>