Class RemoteServiceInvoker
- Namespace
- GroupeIsa.Neos.ClusterCommunication
- Assembly
- GroupeIsa.Neos.ClusterCommunication.dll
Represents the implementation of a client for interacting with the Dapr endpoints over HTTP protocol.
public class RemoteServiceInvoker : RemoteServiceInvokerBase, IRemoteServiceInvoker
- Inheritance
-
RemoteServiceInvoker
- Implements
- Inherited Members
Constructors
RemoteServiceInvoker(IConfiguration, IHttpClientFactory, IHttpContextAccessor, IApplicationContext, INeosLogger<RemoteServiceInvoker>)
Initializes a new instance of the RemoteServiceInvoker class.
public RemoteServiceInvoker(IConfiguration configuration, IHttpClientFactory httpClientFactory, IHttpContextAccessor httpContextAccessor, IApplicationContext applicationContext, INeosLogger<RemoteServiceInvoker> logger)
Parameters
configuration
IConfigurationThe configuration.
httpClientFactory
IHttpClientFactoryThe http client factory.
httpContextAccessor
IHttpContextAccessorProvides access to the current HttpContext.
applicationContext
IApplicationContextThe application context.
logger
INeosLogger<RemoteServiceInvoker>The logger.
Methods
GetByteArrayAsync(RemoteServiceOptions)
Send a GET request with the specified options
and return the response body as a byte array.
public override Task<byte[]> GetByteArrayAsync(RemoteServiceOptions options)
Parameters
options
RemoteServiceOptionsThe options to invoke the method on.
Returns
- Task<byte[]>
A Task<TResult> that will return when the operation has completed with byte array.
GetStringAsync(RemoteServiceOptions)
Send a GET request with the specified options
and return the response body as a string.
public override Task<string> GetStringAsync(RemoteServiceOptions options)
Parameters
options
RemoteServiceOptionsThe options to invoke the method on.
Returns
- Task<string>
A Task<TResult> that will return when the operation has completed with string.
InvokeAsync(RemoteServiceOptions)
Performs service invocation for the service identified by options.ServiceId.ServiceId
and invokes the resource
specified by options.Path.Path
with the
HTTP method.options.HttpMethod.HttpMethod
public override Task InvokeAsync(RemoteServiceOptions options)
Parameters
options
RemoteServiceOptionsThe options to invoke the method on.
Returns
- Task
A Task<TResult> that will return when the operation has completed.
InvokeAsync<TResponse>(RemoteServiceOptions)
Performs service invocation for the service identified by options.ServiceId.ServiceId
and invokes the resource
specified by options.Path.Path
with the
HTTP method.options.HttpMethod.HttpMethod
public override Task<TResponse?> InvokeAsync<TResponse>(RemoteServiceOptions options)
Parameters
options
RemoteServiceOptionsThe options to invoke the method on.
Returns
- Task<TResponse>
A Task<TResult> that will return when the operation has completed.
Type Parameters
TResponse
The type of the data that will be JSON deserialized from the response body.