From: Mike Sassak Date: 2002-02-27T11:17:10+09:00 Subject: Re: RCR?: parallel to until: as_soon_as On Tue, 2002-02-26 at 18:48, Tobias Reif wrote: > I'm not sure if this could work in Ruby, but I want to be able to fire a > block as soon as something happens. > > So @line_count is changed in various places in the program, and the > as_soon_as block watches it; as soon it reaches 100, the block is fired. > > as_soon_as button.pressed? # ... turns true > stuff.do > end > as_soon_as chat_peer.online? > say hi > end > as_soon_as game_state.changed? > all_players.update_screen > end > ... > > But I'm still thinking myself ... > What about using the Observer mixin? or is that to "heavy duty" for what you're thinking? -mike