Re: Subclassing Thread?



Kero wrote:
The usual question is, why would you want that?
A Thread, by its nature, is something that should be running.
Especially delaying the start means... there's no underlying thread yet!

My motivation for wanting the thread in a separate class is simply
convenience. The class will be very large... several pages of code at
least... so putting it into a block would be a little unwieldy.

Thanks very much for your suggestions. I've found another method that
seems to work well also. Rather than subclassing Thread, I have written
the class (call it "User") as a normal class and done this:

Thread.new(args){|args| User.new(args)}

That seems to accomplish what I'm going for.

Thanks for your help!
--
Posted via http://www.ruby-forum.com/.

.



Relevant Pages

  • Re: Subclassing Thread?
    ... Especially delaying the start means... ... there's no underlying thread yet! ... My motivation for wanting the thread in a separate class is simply ...
    (comp.lang.ruby)
  • Re: Samprass legacy error: Fall 1998
    ... guessing he won't be playing just for fun. ... He would be wanting to win ... slams as many as he can. ... So motivation is not a factor here.- ...
    (rec.sport.tennis)
  • Re: are Catholics Christians ?!
    ... I was tempted to reply to David's concern over self-condemnation by ... assuring him that my motivation in wanting to take part was to ensure ...
    (uk.religion.christian)
  • Re: OT - Tiling the Shower
    ... I think the worst part of retiling is ripping out the old. ... for the motivation of wanting something that's at least in this century. ...
    (rec.outdoors.rv-travel)