Add CancellationToken - #51
Conversation
|
This looks great. I'll need to comb over it with fresh eyes, but with a skim it seems to hit the mark nicely. Many thanks! |
|
Note this a breaking change at the runtime level |
|
👍 thanks for the note. Yes, the code on |
nblumhardt
left a comment
There was a problem hiding this comment.
All looks good - just one query. Cheers!
| _root = new Lazy<Task<RootEntity>>(() => _client.GetRootAsync()); | ||
|
|
||
| _root = new Lazy<Task<RootEntity>>(() => _client.GetRootAsync(token)); |
There was a problem hiding this comment.
I'm not sure about this one, since the token could hypothetically need to be kept around until some unspecified later time.
Perhaps, since it's not an operation that's likely to take long anyway, we just ignore cancellation for now, here.
The other option is to stop using Lazy and instead use a lock, field, and helper method so that the call to GetRootAsync() uses the cancellation token of whatever method is calling it. Perhaps a nice addition down the track, unless you're particularly keen :-)
There was a problem hiding this comment.
Perhaps, since it's not an operation that's likely to take long anyway, we just ignore cancellation for now, here.
i think that is reasonable. want me to make the change?
|
Thanks! |
No description provided.