Levin Alexander wrote:
> Hi,
> 
> I am trying to write a some code that expresses a series of 
> Commands/Responses over a serial link.
> 
> In pseudocode, this is what I want to accomplish:
> 
>   conv = Conversation.new(connection) { |x|
>       x.transmit(:init)
>       x.wait_for(:ok)
>       x.transmit(:get_user_input)
>       x.wait_for(:user_data) { |message| response = message.text }
>       puts response
>     rescue TimeoutException => e
>       x.retry if x.attempts < 3
>   }
>   conv.start

I'm guessing #start runs the block? Why not

  Thread.new {conv.start}

Or does the block get executed during Conversation.new, which just
queues up all the commands so that start can call them in order later?

-- 
      vjoel : Joel VanderWerf : path berkeley edu : 510 665 3407