I have created a new block with 2 input ports and 2 output ports
If i connect to port 0 of block work function gets called but when i
connect to port 1 it does’nt (and i m leaving some ports of my block
disconnected)
Here is my confusion: You mentioned one block with two inputs, but the
code above reads self.another_1 and port #0. So it sounds like 2
instances of block another, each with one port in and one port out. Did
you mean this:?
self.connect((self.sniffer,0),(self.another_0,1))
Anyway, if my misunderstanding is correct, the reason work doesnt get
called is because the block only calls work when both inputs have some
data available. Is it possible that the second port does not have any
data sent?
If you would like the two inputs to be asynchronous to each other, you
can set the reserve_items to 0. This means work will be called when data
is available on any port, but does not require data to actually be
available on both ports.
self.input_config(0).reserve_items = 0
-josh
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.