<!--
{
  "availability" : [
    "iOS: 13.0.0 -",
    "iPadOS: 13.0.0 -",
    "macCatalyst: 13.0.0 -",
    "macOS: 10.15.0 -",
    "tvOS: 13.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 6.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "Combine",
  "identifier" : "/documentation/Combine/Publisher/receive(on:options:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "Combine"
    ],
    "preciseIdentifier" : "s:7Combine9PublisherPAAE7receive2on7optionsAA10PublishersO9ReceiveOnVy_xqd__Gqd___16SchedulerOptionsQyd__SgtAA0I0Rd__lF"
  },
  "title" : "receive(on:options:)"
}
-->

# receive(on:options:)

Specifies the scheduler on which to receive elements from the publisher.

```
func receive<S>(on scheduler: S, options: S.SchedulerOptions? = nil) -> Publishers.ReceiveOn<Self, S> where S : Scheduler
```

## Parameters

`scheduler`

The scheduler the publisher uses for element delivery.

`options`

Scheduler options used to customize element delivery.

## Return Value

A publisher that delivers elements using the specified scheduler.

## Discussion

You use the [`receive(on:options:)`](/documentation/Combine/Publisher/receive(on:options:)) operator to receive results and completion on a specific scheduler, such as performing UI work on the main run loop. In contrast with [`subscribe(on:options:)`](/documentation/Combine/Publisher/subscribe(on:options:)), which affects upstream messages, [`receive(on:options:)`](/documentation/Combine/Publisher/receive(on:options:)) changes the execution context of downstream messages.

In the following example, the [`subscribe(on:options:)`](/documentation/Combine/Publisher/subscribe(on:options:)) operator causes `jsonPublisher` to receive requests on `backgroundQueue`, while the
[`receive(on:options:)`](/documentation/Combine/Publisher/receive(on:options:)) causes `labelUpdater` to receive elements and completion on `RunLoop.main`.

```
let jsonPublisher = MyJSONLoaderPublisher() // Some publisher.
let labelUpdater = MyLabelUpdateSubscriber() // Some subscriber that updates the UI.

jsonPublisher
    .subscribe(on: backgroundQueue)
    .receive(on: RunLoop.main)
    .subscribe(labelUpdater)
```

Prefer [`receive(on:options:)`](/documentation/Combine/Publisher/receive(on:options:)) over explicit use of dispatch queues when performing work in subscribers. For example, instead of the following pattern:

```
pub.sink {
    DispatchQueue.main.async {
        // Do something.
    }
}
```

Use this pattern instead:

```
pub.receive(on: DispatchQueue.main).sink {
    // Do something.
}
```

> Note: ``doc://com.apple.Combine/documentation/Combine/Publisher/receive(on:options:)`` doesn’t affect the scheduler used to call the subscriber’s ``doc://com.apple.Combine/documentation/Combine/Subscriber/receive(subscription:)`` method.

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)