Skip to content

🍒[5.9][Concurrency] Rename Job to ExecutorJob, ease transition with typealias #65038

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

Merged
merged 2 commits into from
Apr 12, 2023

Conversation

ktoso
Copy link
Contributor

@ktoso ktoso commented Apr 10, 2023

Description: According to SE review, we want to not take over the Job name. The final API we want here is ExecutorJob . We introduce a typealias Job = ExecutorJob to make the adoption easier, especially by other libraries which provide executors. We should be able to remove the Job typealias once all adopters have moved to ExecutorJob.

The respective Swift Evolution feedback from the first review round:

There was concern about the use of the common term Job as a standard library type, both because it's likely to be frequently shadowed by Job declarations in other modules, and because Job has similar connotations to Task, and the presence of Job and Task types together would be likely to confuse some developers. The Language Workgroup expects that code working with custom executors and jobs will be far less common than code that works with tasks, so giving the type a more unique and descriptive name like ExecutorJob would be appropriate. (If it were possible, the qualified name Executor.Job would be nice, but since Executor is a protocol, that would mean that every implementation of Executor would end up with a Job type nested inside it.)

Risk: Low, existing users would have been using UnownedJob still; Source compatibility is improved for migration period by adding the typealias Job.
Review by: @DougGregor
Testing: CI testing
Original PR: #65006
Radar: rdar://107826321

@ktoso
Copy link
Contributor Author

ktoso commented Apr 10, 2023

@swift-ci please test

@ktoso
Copy link
Contributor Author

ktoso commented Apr 10, 2023

Renaming job sadly overlapped with adding a test which used job type in message... re-running with adjustment.

@ktoso ktoso added 🍒 release cherry pick Flag: Release branch cherry picks swift 5.9 labels Apr 10, 2023
@ktoso ktoso requested review from jckarter and airspeedswift April 11, 2023 05:52
@ktoso ktoso changed the title 🍒[5.9][Concurrency] Rename Job to ExecutorJob, ease transition with typealias #65006 🍒[5.9][Concurrency] Rename Job to ExecutorJob, ease transition with typealias Apr 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🍒 release cherry pick Flag: Release branch cherry picks swift 5.9
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants