Skip to content

Fix AwaitAdapter terminology #3318

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 1 commit into from
Jul 28, 2019
Merged

Conversation

jnm2
Copy link
Contributor

@jnm2 jnm2 commented Jul 13, 2019

The line is blurred because an await adapter is not an awaiter and not an awaitable. An await adapter is an object which adapts various entire styles of asynchronous waiting to a common API.

Calling the variables awaitAdapter is a bit of a mouthful and adapter is too bland. If you squint, you can think of the instance methods as similar in spirit to the C# language concept of an awaiter. Even though it's not the same thing, I think it's close enough to justify the variable name.

Also, if we ever passed these instances to a public API, we'd probably pass them as IAwaiterObject awaiter. I saw this in #3037 and really liked it. (AwaitAdapter is still a better name for the class because the class specifically exists in order to adapt, whereas the interface could be used on things that are not adapters.)

@jnm2 jnm2 requested a review from a team July 13, 2019 01:33
@mikkelbu mikkelbu merged commit 13186da into nunit:master Jul 28, 2019
@mikkelbu mikkelbu added this to the 3.13 milestone Jul 28, 2019
@jnm2 jnm2 deleted the fix_await_terminology branch July 28, 2019 16:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants