Martin DeMello wrote: > I want to put something in INSERT CODE HERE that will call a method in > the main thread when IRB.start_in_fxirb returns (i.e. just before the > other thread dies), rather than having to wait for the GC to collect the > the thread and then put in a check for @irb.alive?. Is there any good > way to do this? (What I'm trying to do is have some way for the fxirb > widget to notify the program containing it that the irb session has > ended. Right now my choices seem to be to call exit (exits everything), > to sleep(briefly) after I call @irb.run, and then check @irb.alive? > (annnoying), to call GC.start everytime I call @irb.run and then check > @irb.alive? (also annoying), or to have the thread itself notify > something when it dies (but I can't quite think of how to do it).) In line with your last thought, what about writing something to a queue from the irb thread and then periodically (using a chore) reading the queue in the main thread?