---
title: "init(upstream:count:)"
framework: combine
role: symbol
role_heading: Initializer
path: "combine/publishers/collectbycount/init(upstream:count:)"
---

# init(upstream:count:)

Creates a publisher that buffers a maximum number of items.

## Declaration

```swift
init(upstream: Upstream, count: Int)
```

## Parameters

- `upstream`: The publisher that this publisher receives elements from.
- `count`: The maximum number of received elements to buffer before publishing.
