Skip to content

Remove async from AttachmentAllocator lookup #224

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

Closed

Conversation

eliseomartelli
Copy link
Contributor

The lookup(hostname:) method in AttachmentAllocator no longer requires
async, as it only performs a synchronous dictionary lookup.

The `lookup(hostname:)` method in `AttachmentAllocator` no longer requires
async, as it only performs a synchronous dictionary lookup.
@@ -101,7 +101,7 @@ public actor NetworkService: Sendable {
}

let hostname = try message.hostname()
let index = try await allocator.lookup(hostname: hostname)
let index = try allocator.lookup(hostname: hostname)
Copy link
Member

Choose a reason for hiding this comment

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

Because AttachmentAllocator is an actor, callers still need to access every method asynchronously. The removal of the async from the func lookup(hostname: String) definition does not change this, it's solely to mark that that method does not call anything async inside of itself.

Copy link
Member

@dcantah dcantah Jun 24, 2025

Choose a reason for hiding this comment

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

If you get rid of the diff in this file this change LGTM

@crosbymichael
Copy link
Contributor

Thank you for the change. When you have time, please update the change. I'll close this and when you have the updated patch, feel free to open a new PR with the change.

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.

4 participants