Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Introduce Scheduler.dependencies() #86

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

kabiroberai
Copy link
Contributor

This API enables the creation of schedulers that propagate dependencies across schedule calls. For motivation and further discussion, see #85.

Comment on lines +57 to 59
static let liveValue = DispatchQueue.main.dependencies()
static let testValue = AnySchedulerOf<DispatchQueue>
.unimplemented(#"@Dependency(\.mainQueue)"#)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was worried that users would explicitly need to use dependencies() in the test value, but then I realized that test schedulers already forward dependencies since they invoke the closure immediately (inheriting task locals). Though I'm not sure if this applies to the delay/interval APIs; dunno if we need to add explicit tests for those.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant