---
title: Publishers.CollectByCount
framework: combine
role: symbol
role_heading: Structure
path: combine/publishers/collectbycount
---

# Publishers.CollectByCount

A publisher that buffers a maximum number of items.

## Declaration

```swift
struct CollectByCount<Upstream> where Upstream : Publisher
```

## Topics

### Creating a collect by count publisher

- [init(upstream:count:)](combine/publishers/collectbycount/init(upstream:count:).md)

### Declaring supporting types

- [Publishers.CollectByCount.Output](combine/publishers/collectbycount/output.md)
- [Publishers.CollectByCount.Failure](combine/publishers/collectbycount/failure.md)

### Inspecting publisher properties

- [upstream](combine/publishers/collectbycount/upstream.md)
- [count](combine/publishers/collectbycount/count.md)

### Comparing publishers

- [==(_:_:)](combine/publishers/collectbycount/==(_:_:).md)

### Default Implementations

- [Equatable Implementations](combine/publishers/collectbycount/equatable-implementations.md)

## Relationships

### Conforms To

- [Equatable](swift/equatable.md)
- [Publisher](combine/publisher.md)

## See Also

### Reducing elements

- [Publishers.Collect](combine/publishers/collect.md)
- [Publishers.CollectByTime](combine/publishers/collectbytime.md)
- [Publishers.TimeGroupingStrategy](combine/publishers/timegroupingstrategy.md)
- [Publishers.IgnoreOutput](combine/publishers/ignoreoutput.md)
- [Publishers.Reduce](combine/publishers/reduce.md)
- [Publishers.TryReduce](combine/publishers/tryreduce.md)
