Use default paramters for methods where it makes sense #858
Unanswered
SeanFarrow
asked this question in
Q&A
Replies: 2 comments
-
For the public APIs it would improve the API and thus a PR would be great. Internally within EventFlow we really need to make sure that the cancellation tokens provided by developers are passed along, and using defaults there will make it harder to spot if we forget to pass one along. |
Beta Was this translation helpful? Give feedback.
0 replies
-
Ok, how about the following as separate PR’s:
Firstly, add a default CancellationToken (i.e CancellationToken.None) to any public methods that take a CancellationToken.
My question here would be what do you consider as public? To my thinking, it would be any class implementing an interface, but feel free to correct my understanding.
Secondly, following on from this, ensure that any cancellationToken (including the default) is passed to private methods.
I’m happy to do the first this weekend and the second within the next few weeks.
Thanks,
Sean.
From: Rasmus Mikkelsen <[email protected]>
Sent: 06 November 2020 12:45
To: eventflow/EventFlow <[email protected]>
Cc: Sean Farrow <[email protected]>; Author <[email protected]>
Subject: Re: [eventflow/EventFlow] Use default paramters for methods where it makes sense (#804)
For the public APIs it would improve the API and thus a PR would be great.
Internally within EventFlow we really need to make sure that the cancellation tokens provided by developers are passed along, and using defaults there will make it harder to spot if we forget to pass one along.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub<#804 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/AALDK7SRY5PPLGFBUFNWJILSOPVT7ANCNFSM4TMLFU5A>.
|
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
It would be really nice if, where possible, EventFlow methods used default C# parameters.
I noticed this when looking at the way CancellationTokens are passed around.
Is this an area in which a PR would be accepted?
Thanks,
Sean.
Beta Was this translation helpful? Give feedback.
All reactions