A lightweight, cancellable Promise implementation for Swift and Objective-C with full thread safety and generic error support.
Tomorrowland is a Promises library for Swift and Objective-C that provides a standard way to handle asynchronous tasks, chain operations, and manage cancellations. It solves the problem of managing complex asynchronous workflows in iOS, macOS, watchOS, and tvOS apps by offering performance improvements, true cancellable promises, and enhanced control compared to alternatives like PromiseKit and Hydra.
iOS and macOS developers building applications that require robust asynchronous task handling, such as network requests, UI updates, and operations that need fine-grained cancellation control. It is particularly suited for developers who need type-safe error handling and seamless Swift/Objective-C interoperability.
Developers choose Tomorrowland over other Promise libraries because it offers true cancellable promises where the promise body can observe and respond to cancellation requests, full thread safety using atomics for better performance, and generic error types for more powerful, type-safe error handling. It also provides callback suppression via PromiseInvalidationToken to prevent stale UI updates and automatic cancellation propagation.
Lightweight Promises for Swift & Obj-C
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Allows promise bodies to observe and respond to cancellation requests via resolver.onRequestCancel, enabling tasks like network requests to stop mid-execution, unlike libraries that only detect cancellation errors.
Fully generic over error types for type-safe error handling, avoiding limitations of libraries restricted to Swift.Error and enabling more powerful error composition without force-casting.
Uses atomics for thread safety instead of extra dispatch queues, reducing overhead and improving performance compared to alternatives like PromiseKit or Hydra.
Implements PromiseInvalidationToken to suppress callbacks when results are no longer needed, preventing stale UI updates without relying solely on cancellation.
Cannot be integrated via SwiftPM due to reliance on a private Obj-C module, forcing teams to use CocoaPods, Carthage, or manual installation, which limits modern dependency management options.
Advanced features like cancellation propagation, generic errors, and PromiseInvalidationToken require significant upfront understanding, increasing onboarding time for developers accustomed to simpler promise libraries.
Requires more boilerplate code for promise creation and handling, such as specifying contexts and managing resolvers, compared to more concise alternatives like PromiseKit for basic use cases.
Tomorrowland is an open-source alternative to the following products:
Hydra is a fast and flexible password-cracking tool that supports numerous network protocols, allowing security professionals to test the strength of login credentials through brute-force or dictionary attacks.
PromiseKit is a Swift and Objective-C framework that provides a clean, readable API for asynchronous programming using promises and futures.