Creates a task filtering out duplicate items.
Items are processed sequentially and output order is preserved. Only the first occurrence of each unique item is yielded.
The type of items in the stream
The type of comparison key
Optional
Optional function to extract comparison key from items
A task that filters out duplicate items
Maintains a Set of all seen items in memory. For large or infinite streams with many unique items, this may cause memory issues.
Set
Creates a task filtering out duplicate items.
Items are processed sequentially and output order is preserved. Only the first occurrence of each unique item is yielded.