DEV.co
Open-Source Testing · pointfreeco

combine-schedulers

combine-schedulers is a Swift library providing custom Combine Framework schedulers designed to make asynchronous publisher testing deterministic and controlled. It includes TestScheduler for time-based testing, AnyScheduler for type erasure, and ImmediateScheduler for synchronous execution.

Source: GitHub — github.com/pointfreeco/combine-schedulers
789
GitHub stars
108
Forks
Swift
Primary language
MIT
License (OSI-approved)

Key facts

Objective fields from the source. Values we can't verify are shown as “Unknown” rather than guessed.

FieldValue
Repositorypointfreeco/combine-schedulers
Ownerpointfreeco
Primary languageSwift
LicenseMIT — OSI-approved
Stars789
Forks108
Open issues4
Latest release1.2.0 (2026-04-16)
Last updated2026-07-03
Sourcehttps://github.com/pointfreeco/combine-schedulers

What combine-schedulers is

A Swift Package offering Scheduler protocol implementations that abstract away threading concerns in Combine pipelines. Key components include TestScheduler (virtual time control), AnyScheduler (type-erasing wrapper), and several specialized schedulers for animations and UI work, enabling testable reactive code without blocking on real time.

Quickstart

Get the combine-schedulers source

Clone the repository and explore it locally.

terminalbash
git clone https://github.com/pointfreeco/combine-schedulers.gitcd combine-schedulers# follow the project's README for install & configuration

Need it deployed, integrated, or customized instead? DEV.co ships production installs.

Best use cases

Unit testing Combine publishers with time-dependent operators

TestScheduler enables deterministic testing of debounce, throttle, delay, timeout, and receive(on:) operations by allowing manual advancement of virtual time without real delays.

Dependency injection of schedulers without generic pollution

AnyScheduler eliminates the need to introduce generics across view models and view layers when you want to swap schedulers between production (DispatchQueue.main) and tests (immediate scheduler).

Building snapshot and UI tests for Combine-based view models

ImmediateScheduler and AnyScheduler allow snapshot testing frameworks to render deterministic UI outputs from async publishers without timing waits or flaky expectations.

Implementation considerations

  • Requires Swift 5.1+ and Combine availability (iOS 13+, macOS 10.15+); check deployment target compatibility before adoption.
  • TestScheduler virtual time is per-instance; ensure test isolation and avoid sharing scheduler instances across concurrent test cases.
  • AnyScheduler introduces a small runtime indirection via type erasure; avoid using it in hot inner-loop code paths where scheduler overhead matters.
  • Switching schedulers in production code (e.g., AnyScheduler) necessitates clear documentation of expected scheduler types to avoid runtime type mismatches.
  • TestScheduler does not guarantee exact scheduling order under complex concurrent scenarios; validate test assumptions against actual dispatcher behavior.

When to avoid it — and what to weigh

  • Your codebase does not use Combine Framework — This library is specifically designed for Combine pipelines. If you use async/await, Futures, or other concurrency models exclusively, this library provides no value.
  • You need cross-platform (non-Apple) scheduling — combine-schedulers is Swift/Apple-ecosystem only. For server-side or cross-platform reactive code, consider alternatives like RxSwift or native async/await.
  • You require real-time scheduling guarantees — TestScheduler uses virtual time; it cannot replace actual DispatchQueue or OperationQueue for production code requiring real-world timing precision or thread safety.
  • Your test suite already avoids time-dependent operators — If your reactive architecture is already designed to sidestep timing concerns (e.g., through careful state management), the TestScheduler gains diminishing value.

License & commercial use

MIT License. Permits commercial use, modification, distribution, and private use. Requires license and copyright notice inclusion. No warranty or liability provided.

MIT is a permissive OSI-approved license. Commercial use in proprietary iOS/macOS applications is explicitly permitted. No royalties, license fees, or approval required. Ensure MIT notice is retained in your distribution.

DEV.co evaluation signals

Editorial assessment — not user reviews. Directional, with an explicit confidence level.

SignalAssessment
MaintenanceActive
DocumentationStrong
License clarityClear
Deployment complexityLow
DEV.co fitGood
Assessment confidenceHigh
Security considerations

No known security vulnerabilities reported or disclosed in README. As a testing and scheduler utility library with no network, file I/O, or cryptographic operations, attack surface is minimal. Use standard Swift compiler and runtime hardening. Review for timing-side-channel concerns if used in cryptographic test code.

Alternatives to consider

RxSwift with RxTest

Cross-platform reactive library with mature testing scheduler (TestScheduler equivalent). Useful if you need non-Apple platform support or are already invested in RxSwift ecosyste. Larger dependency footprint.

AsyncSequence / Swift Concurrency (native async/await)

Apple's modern concurrency model available iOS 13+. Gradually replaces Combine for new code. Less boilerplate for simple async flows, but lacks Combine's rich operator ecosystem and scheduler abstraction.

Reactive Extensions (ReactiveX) or Futures / Promises libraries

Alternative reactive abstractions that may provide their own scheduler or timing utilities. Lighter-weight if you don't need full Combine compatibility or prefer a different reactive paradigm.

Software development agency

Build on combine-schedulers with DEV.co software developers

combine-schedulers eliminates timing flakiness from reactive tests. Add it to your Swift package and simplify scheduler dependencies with AnyScheduler and TestScheduler.

Talk to DEV.co

Related open-source tools

Surfaced by semantic similarity across the DEV.co open-source index.

Related on DEV.co

Explore the category and the services that help you build with it.

combine-schedulers FAQ

Can I use TestScheduler in production code?
No. TestScheduler uses virtual time and is designed exclusively for deterministic testing. Use DispatchQueue, OperationQueue, or RunLoop in production; inject them via AnyScheduler for runtime flexibility.
Does AnyScheduler have runtime overhead?
Yes, minimal. Type erasure adds a small indirection (function pointer dispatch). For most UI and async code, the cost is negligible. Avoid AnyScheduler in performance-critical inner loops.
Is this compatible with async/await?
Not directly. combine-schedulers is Combine-specific. Swift Concurrency has its own scheduler abstraction (Swift 5.9+). If migrating away from Combine, you will not need this library.
What Swift versions are supported?
Unknown from provided data. Refer to GitHub releases or swift-versions badge. Minimum is likely Swift 5.1 (Combine introduction). Check deployment target requirements for your project.

Work with a software development agency

Need help beyond evaluating combine-schedulers? DEV.co is a software development agency offering software development services and web development for teams of every size. Our software developers and web developers build custom software, web applications, APIs, and open-source testing integrations — and maintain them long-term.

Ready to test your Combine pipelines deterministically?

combine-schedulers eliminates timing flakiness from reactive tests. Add it to your Swift package and simplify scheduler dependencies with AnyScheduler and TestScheduler.