org.erights.e.elib.oldeio
Class CharPipeAdapter

java.lang.Object
  |
  +--org.erights.e.elib.oldeio.CharPipeAdapter
All Implemented Interfaces:
Thunk

public class CharPipeAdapter
extends Object
implements Thunk

Untamed: Moves characters from a Reader to a Writer in a blocking loop, which should be run in a separate vat & runner.

Author:
Mark S. Miller

Field Summary
private  Reader myReader
           
private  Writer myWriter
           
 
Constructor Summary
CharPipeAdapter(Reader reader, Writer writer)
          Enabled: May be called from any thread.
 
Method Summary
 Object run()
          Enabled: Should only be called from the new vat.
 Object[] start(String optName)
          Enabled:
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

myReader

private Reader myReader

myWriter

private Writer myWriter
Constructor Detail

CharPipeAdapter

public CharPipeAdapter(Reader reader,
                       Writer writer)
Enabled: May be called from any thread.

Parameters:
reader - Assumed to be thread-safe.
writer - Assumed to be thread-safe.
Method Detail

run

public Object run()
Enabled: Should only be called from the new vat.

Normal users should only call start(String)

Specified by:
run in interface Thunk

start

public Object[] start(String optName)
Enabled:

Parameters:
optName - Names the newly created vat
Returns:
A pair of the new vat and the outcomeVow for when the io is finished.


comments?