Set

A set stores unique values. Adding a value that is already present has no effect, so sets are useful for membership checks.

The dictionary in Dictionary and map stores ticket details, but the external match service may retry the same event. The help desk needs a separate set of processed event IDs.

visited_pages = empty set
add "/home" to visited_pages
is_known = "/home" is in visited_pages

Hash-based sets usually provide average O(1) insertion, removal, and membership checks. They do not provide indexed access, and their ordering guarantees depend on the language and implementation.

The set records only membership, not the ticket payload or arrival order. The event guard remains separate from the ticket index.

See Set examples for runnable examples in supported programming languages.