retry a Poe::Wheel::ReadWrite->put()

Seth Daniel <[email protected]>
Newsgroups gmane.comp.lang.perl.poe
Message-ID <[email protected]>
Hi,

I have a program that builds a parent session with N number of child
sessions.  Each child session has a single Poe::Wheel::ReadWrite object.
The parent session receives some data and can choose any of the child
sessions to pass it to (essentially the parent acts as a load balancer).
The chosen child session then writes the data (in most cases this will
be a socket connection).  

What I would like to happen is this: if the write from the child session
fails I would like to send the data to one of the other child sessions.
I cannot figure out how to do this with POE.  

Once the child session performs a put(), the write will fail and I
receive an ErrorEvent.  I don't seem to be able to get the data that was
in the original put().  So, if I buffer the data, perform the put(), and
then receive an error I can use the wheel_id to identify the data that
failed to be written.  However, I don't get an event when the write is
successful so it doesn't seem like I can remove items from the buffer.

How can I do this?  I know I'm missing something very fundamental.

Thank you.

-- 
seth /\ sethdaniel.org
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.