1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
use Pin;
use ;
use Stream;
use mpsc;
/// # ItemStream
///
/// An asynchronous stream wrapper around a Tokio unbounded channel receiver.
///
/// `ItemStream` implements the `Stream` trait from the `futures` crate,
/// allowing it to be used with stream combinators and async iteration.
/// It primarily serves as a way to adapt Tokio's channel receivers to
/// the `Stream` interface.
///
/// ## Usage Context
///
/// This stream is typically used to receive processed items from a batched
/// processing pipeline. Each item represents a processed result that is
/// ready to be consumed by downstream components.
///
/// ## Limitations
///
/// - No built-in backpressure mechanism (uses unbounded channels)
/// - No mechanism to peek at the next item without consuming it
///
/// ## Implementation Details
///
/// The stream is backed by a Tokio unbounded channel receiver, which means:
/// - It will never block on `poll_next` even if the channel is empty
/// - It will return `None` when all senders are dropped
/// - It has no backpressure mechanism
///
/// ## TODO's:
/// Back this with any type that can support a stream.
///