xtern commented on a change in pull request #9526:
URL: https://github.com/apache/ignite/pull/9526#discussion_r753040155
##########
File path:
modules/platforms/dotnet/Apache.Ignite.Core/Services/IServiceContext.cs
##########
@@ -65,5 +66,13 @@ public interface IServiceContext
/// Affinity key, possibly null.
/// </value>
object AffinityKey { get; }
+
+ /// <summary>
+ /// Gets context of the current service call.
+ /// </summary>
+ /// <returns>Context of the current service call.</returns>
+ /// <seealso cref="IServiceCallContext"/>
+ [IgniteExperimental]
+ IServiceCallContext CurrentCallContext();
Review comment:
Thanks, the "getter" method has been changed.
But for the "setter" method (in implementation) I see 3 options:
1. Leave the static method SetCurrentCallContext(..) in the ServiceContext
(current solution).
2. Make it instance method (normal "setter").
3. Extract the threadlocal to another container-class with static methods to
reading/storing the context (similar to current java implementation).
Personally, I prefer the second one, but accessing the ServiceContext
instance while executing a service method requires a bit of reworking of the
current service logic:
a. Store ServiceContext instead of a service in handleregistry.
b. Store reference to the Service in ServiceContext implementation.
WDYT?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]