/// <summary>Writes data to the Channel</summary> /// <remarks> /// If this Channel has an underlying buffer, and this buffer is full, then Write blocks /// until a reader has read from the Channel. Otherwise Write puts the data into the buffer and returns.<p/> /// If this is an unbuffered Channel, then Write waits until data is read by a reader. /// </remarks> /// <param name="data">Data to be written to the Channel</param> /// <exception cref="Jibu.PoisonException">Thrown if the channel has been poisoned.</exception> // <example> // - Unbuffered Channel Example - // <code><include UnbufferedChannelExample/UnbufferedChannelExample.cs></code> // </example> // <example> // - Buffered Channel Example - // <code><include BufferedChannelExample/BufferedChannelExample.cs></code> // </example> public void Write(T data) { internalChannel.Write(data); }
/// <summary>Writes data to the Channel.</summary> /// <remarks>The Write method writes data to the Channel. If the ChannelWriter /// is the writing end of a buffered Channel, Write will return once it has written /// data to the buffer. If the ChannelWriter is a writing end of an unbuffered Channel, Write returns /// when, and only when, the data is read by another task.</remarks> /// <exception cref="PoisonException">If the Channel is poisoned</exception> /// <param name="data">The data to write to the Channel.</param> // <example> // - Unbuffered Channel Example - // <code><include UnbufferedChannelExample/UnbufferedChannelExample.cs></code> // </example> // <example> // - Buffered Channel Example - // <code><include BufferedChannelExample/BufferedChannelExample.cs></code> // </example> public void Write(T data) { channel.Write(data); }