DESCRIPTION
- fifo
-
creates a stream-oriented in-memory channel and returns its
handle. There is no restriction on the ultimate size of the channel,
it will always grow as much as is necessary to accomodate the data
written into it.
In contrast to the channels generated by memchan a channel
created here effectively represents an U-turn. All data written into
it can be read out, but only in the same order. This also means that a
fifo channel is not seekable.
The channels created here can be transfered between interpreters in
the same thread and between threads, but only as a whole. It is not
possible to use them to create a bi- or unidirectional connection
between two interpreters.
Memory channels created by fifo provide two read-only options
which can be queried via the standard fconfigure command. These
are
- -length
-
The value of this option is the number of bytes currently
stored in the queried memory channel.
- -allocated
-
The value of this option is the number of bytes currently
allocated by the queried memory channel. This number is at
least as big as the value of -length.
As the channels generated by fifo grow as necessary they are
always writable. This means that a writable fileevent-handler
will fire continuously.
The channels are also readable if they contain more than zero
bytes. Under this conditions a readable fileevent-handler will
fire continuously.