annotate src/lib/istream-tee.h @ 22664:fea53c2725c0

director: Fix director_max_parallel_moves/kicks type Should be uint, not time.
author Timo Sirainen <timo.sirainen@dovecot.fi>
date Thu, 09 Nov 2017 12:24:16 +0200
parents 9d878b1dc028
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
6410
e4eb71ae8e96 Changed .h ifdef/defines to use <NAME>_H format.
Timo Sirainen <tss@iki.fi>
parents: 6142
diff changeset
1 #ifndef ISTREAM_TEE_H
e4eb71ae8e96 Changed .h ifdef/defines to use <NAME>_H format.
Timo Sirainen <tss@iki.fi>
parents: 6142
diff changeset
2 #define ISTREAM_TEE_H
4266
662578b5ae22 Added tee-istream, which can be used to create multiple readable input streams from one input stream.
Timo Sirainen <timo.sirainen@movial.fi>
parents:
diff changeset
3
662578b5ae22 Added tee-istream, which can be used to create multiple readable input streams from one input stream.
Timo Sirainen <timo.sirainen@movial.fi>
parents:
diff changeset
4 /* Tee can be used to create multiple child input streams which can access
662578b5ae22 Added tee-istream, which can be used to create multiple readable input streams from one input stream.
Timo Sirainen <timo.sirainen@movial.fi>
parents:
diff changeset
5 a single non-blocking input stream in a way that data isn't removed from
662578b5ae22 Added tee-istream, which can be used to create multiple readable input streams from one input stream.
Timo Sirainen <timo.sirainen@movial.fi>
parents:
diff changeset
6 memory until all child streams have consumed the input.
662578b5ae22 Added tee-istream, which can be used to create multiple readable input streams from one input stream.
Timo Sirainen <timo.sirainen@movial.fi>
parents:
diff changeset
7
662578b5ae22 Added tee-istream, which can be used to create multiple readable input streams from one input stream.
Timo Sirainen <timo.sirainen@movial.fi>
parents:
diff changeset
8 If the stream's buffer gets full because some child isn't consuming the
662578b5ae22 Added tee-istream, which can be used to create multiple readable input streams from one input stream.
Timo Sirainen <timo.sirainen@movial.fi>
parents:
diff changeset
9 data, other streams get returned 0 by i_stream_read(). */
6142
6c0bfc35af03 Removed memory pool parameter from iostreams. Default pool was almost always
Timo Sirainen <tss@iki.fi>
parents: 4266
diff changeset
10 struct tee_istream *tee_i_stream_create(struct istream *input);
10392
9d878b1dc028 Added tee_i_stream_child_is_waiting().
Timo Sirainen <tss@iki.fi>
parents: 6410
diff changeset
11 /* Returns TRUE if last read() operation returned 0, because it was waiting
9d878b1dc028 Added tee_i_stream_child_is_waiting().
Timo Sirainen <tss@iki.fi>
parents: 6410
diff changeset
12 for another tee stream to read more of its data. */
9d878b1dc028 Added tee_i_stream_child_is_waiting().
Timo Sirainen <tss@iki.fi>
parents: 6410
diff changeset
13 bool tee_i_stream_child_is_waiting(struct istream *input);
4266
662578b5ae22 Added tee-istream, which can be used to create multiple readable input streams from one input stream.
Timo Sirainen <timo.sirainen@movial.fi>
parents:
diff changeset
14
6142
6c0bfc35af03 Removed memory pool parameter from iostreams. Default pool was almost always
Timo Sirainen <tss@iki.fi>
parents: 4266
diff changeset
15 struct istream *tee_i_stream_create_child(struct tee_istream *tee);
4266
662578b5ae22 Added tee-istream, which can be used to create multiple readable input streams from one input stream.
Timo Sirainen <timo.sirainen@movial.fi>
parents:
diff changeset
16
662578b5ae22 Added tee-istream, which can be used to create multiple readable input streams from one input stream.
Timo Sirainen <timo.sirainen@movial.fi>
parents:
diff changeset
17 #endif