I am currently redesigning a program that shall accept input
from both a GUI and from a terminal window that runs irb.

In reaction to the input, some output will be written to the
terminal or/and some controls in the GUI will change.

I need help on the basic architecture of such a system.
I have two rather vague ideas:

(1) Somehow run the irb terminal within the GUI's event loop?

(2) One thread runs the GUI, one thread runs the terminal?

Any comment will be appreciated, Joachim