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

Async match support #51

Closed
domn1995 opened this issue Aug 24, 2022 · 2 comments · Fixed by #58
Closed

Async match support #51

domn1995 opened this issue Aug 24, 2022 · 2 comments · Fixed by #58
Labels
enhancement New feature or request good first issue Good for newcomers

Comments

@domn1995
Copy link
Owner

domn1995 commented Aug 24, 2022

I've been using the library in production code for a while now, and one use that would be useful is an async match method.

The use case here is when the matching logic is asynchronous due to a union being wrapped by a Task.

@domn1995
Copy link
Owner Author

domn1995 commented Aug 24, 2022

Should it be called MatchAsync() or just Match()?

@domn1995 domn1995 added enhancement New feature or request good first issue Good for newcomers labels Aug 24, 2022
@KarolBajkowski
Copy link

KarolBajkowski commented Aug 24, 2022

Async Match Parameters

I'll put my 5 cents on that if you don't mind ;)
Async match will be extremely useful and fulfil the gap. Async methods are very common in many c# projects.

Should it be called MatchAsync() or just Match()?

I think MatchAsync will be closer to the standard convention in the .net world. Many (if not almost all) well-known .net libraries add *Async suffix to async methods. I think it's a good convention and helps reading the code (if you see the Async suffix you know that probably you want also the await keyword at the beginning, or you need special attention that depends on the case - and you can deduce all of this without the help from an IDE). Ergonomics shouldn't suffer too much with Async suffix IMHO.

@domn1995 domn1995 changed the title Match functionality improvements Async match support Sep 21, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants