Orleans.SyncWork icon indicating copy to clipboard operation
Orleans.SyncWork copied to clipboard

Dispose of GrainCancellationTokenSource

Open hendrikdevloed opened this issue 11 months ago • 1 comments

Given that

public sealed class GrainCancellationTokenSource : IDisposable

Should https://github.com/OrleansContrib/Orleans.SyncWork/blob/47bbfe19d8b474db3c8c84182e73ed9f67662382/src/Orleans.SyncWork/SyncWorker.cs#L44

become

        using var cts = new GrainCancellationTokenSource();
        return await Start(request, cts.Token);

?

hendrikdevloed avatar Mar 18 '24 13:03 hendrikdevloed

I'm not totally sure if this needs to be done or not... would the source stay in scope for the full duration of the sync work progressing? would need to do some testing.

Kritner avatar Mar 19 '24 13:03 Kritner