Skip to content

Rename async and await on both FIFOQueue and ActorQueue #10

@dfed

Description

@dfed

Goals

  • Ensure syntax highlighting does not get confused by avoiding the use of language keywords in API

Non-Goals

  • Avoid a breaking API change

Discussion
Our current async/await API was inspired by both DispatchQueue's async/sync APIs as well as Swift Concurrency Syntax's async and await keywords. However, Xcode's syntax highlighting gets confused by this API choice:

screenshot of Xcode syntax highlighting showing `await` as if it were a language keyword rather than a method call

As such, I'd like to change the name of these APIs.

@ktoso's discussion of creating ordered tasks from nonisolated contexts has me thinking of two possibilities for replacing the async and await APIs in FIFOQueue and ActorQueue:

  1. enqueue and enqueueAndWait
  2. send and sendAndWait

I'm currently partial to the former, but am curious to get input on these options. I'm also open to alternative API suggestions!

I hope to include this name change in the 0.2.0 release of this library, which should also include the API changes in #6 and #9.

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions