Pavel Pereslegin created IGNITE-16233:
-----------------------------------------

             Summary: Improve public API for setting caller context to service 
proxy.
                 Key: IGNITE-16233
                 URL: https://issues.apache.org/jira/browse/IGNITE-16233
             Project: Ignite
          Issue Type: Sub-task
            Reporter: Pavel Pereslegin
             Fix For: 2.13


*Motivation.*

When retrieving a proxy service, the user can specify optional parameters: 
{{timeout}} and {{sticky}}.
When adding a new optional parameter (in discussed case - "context"), for the 
convenience of the user, several methods are added at once (with a different 
set of optional parameters).
Thus, the number of methods can grow geometrically with the addition of each 
new parameter.

*Suggested options.*

# Add {{ServiceProxyConfiguration}} which will combine all proxy settings.
{code:java}
ignite.services().serviceProxy(new ServiceProxyConfiguration(name, 
cls).setContext(callCtx));
{code}  
   {color:#DE350B}Adds yet another "config" object, complicates the use of the 
API.{color}
# Add a new method "withContext(callCtx)" ({{returns IgniteServices}}) to the 
{{IgniteServices}} interface.
{code:java}
Ignite.services().withContext(callCtx).serviceProxy(name,...)
{code}
{color:#DE350B}Most of the {{IgniteServices}} methods are not related to the 
service call context (deploy, cancel of the service, etc.). May be confusing 
for the user. Not clear what to do with the "timeout" and "sticky" 
parameters.{color}
# Add a new "withContext(callCtx)" method which returns a new interface 
{{IgniteServiceProxies}} (name can be changed).
{code:java}
Ignite.services().withContext(callCtx).serviceProxy(name,...)
{code}
The new interface has a not very clear purpose and naming (looks like "service 
proxy builder"). May be confusing for the user. Not clear what to do with the 
"timeout" and "sticky" parameters.





--
This message was sent by Atlassian Jira
(v8.20.1#820001)

Reply via email to