Skip to content

Latest commit

 

History

History
32 lines (22 loc) · 509 Bytes

README.md

File metadata and controls

32 lines (22 loc) · 509 Bytes

Schrodinger

An extremely simple promise library.

Usage

Add a Package.swift dependency:

.Package(url: "https://github.com/OpenKitten/Schrodinger.git", majorVersion: 1)

Run code asynchronously and await their results. Supports error throwing.

let promisedResult = async {
	// Run your heavy code
	throw An.error
	
 	return successfulResults
}

try promise.await()

And set custom timeouts.

// times out after a minute
let promise = async(timingOut: .seconds(60)) {
	...
}