asyncTransmitterF :: Socket -> F String b asyncTransceiverF :: Socket -> F String String
asyncTransmitterF socket
asyncTransmitterF
is an asynchronous version of transmitterF.
Since the current fudget library implementation is sequential and deterministic, the synchronous write operations used by transmitterF may block the entire program. For programs that write large amount of data to a slow consumer, e.g., a program that outputs to the audio device, this might be a problem.
asyncTransmitterF
uses asynchronous writes and thus never blocks the program. On the other
hand, it might have to buffer large amounts of data, since there is no flow
control between asyncTransmitterF
and the fudget that produces the data. A producer like
numbersSP 0
where
numbersSP n = putSP (show n) (numberSP (n+1))
will cause the program to run out of memory sooner or later (probably sooner). But there is no limit on the size of a single message, as long as it is produced lazily, so a producer like
putSP (show [1..]) nullSP
will work fine.
asyncTransceiverF
: Strings received from the peer.
An empty string indicates the end of the stream and means that the
peer has closed the connection. asyncTransmitterF
: no output is produced.
socket :: Socket
openFileAsSocketF "/dev/audio" "w" asyncTransmitterF
The corresponing fudgets with syncronous write: transmitterF, transceiverF.
This page documents work progress. Information on this page is subject to change without notice and does not represent a commitment on the part of the Fudgets corporation.
There is no way to discard data in the buffer.