Streams using Text
by encoding in Utf 8.
Documentation
Represents whether the stream transaction was a success or a failure;
nothing is done by the library with the attached value. If you do not need
to send back a value to the caller of withStream
, you can use
a Result
().
The core data type for a Stream. It can only be created using withStream
.
invalidate :: Stream -> IO ()Source
Doesn't fail, but tells the client that all the data sent by the stream so far has been invalidated, and hence the queue of messages to be sent is cleared.
withStream :: Handle -> (Stream -> IO (Result a)) -> IO aSource
Opens a stream using the given handle and passes it to the function, and then unwraps the result given and gives any user data that the specific function wants to give back.
write :: Stream -> Text -> IO ()Source
Writes partial or full data over a Stream
, placing it in the queue of
data to be sent. Encodes the Data.Text.Text
with Utf8
into a strict Data.ByteString.ByteString
.