提交 fd2370e8 编写于 作者: H Heejae Chang

some more rename

上级 6f3b54f3
...@@ -72,7 +72,7 @@ public static async Task<RemoteHostClient> CreateAsync(Workspace workspace, bool ...@@ -72,7 +72,7 @@ public static async Task<RemoteHostClient> CreateAsync(Workspace workspace, bool
// this is what consumer actually use to communicate information // this is what consumer actually use to communicate information
var serviceStream = await _inprocServices.RequestServiceAsync(serviceName, cancellationToken).ConfigureAwait(false); var serviceStream = await _inprocServices.RequestServiceAsync(serviceName, cancellationToken).ConfigureAwait(false);
return new ServiceHubJsonRpcConnection(callbackTarget, serviceStream, _remotableDataRpc.Share(), cancellationToken); return new JsonRpcConnection(callbackTarget, serviceStream, _remotableDataRpc.Share(), cancellationToken);
} }
protected override void OnStarted() protected override void OnStarted()
......
...@@ -10,10 +10,10 @@ ...@@ -10,10 +10,10 @@
namespace Microsoft.VisualStudio.LanguageServices.Remote namespace Microsoft.VisualStudio.LanguageServices.Remote
{ {
internal class ServiceHubJsonRpcConnection : RemoteHostClient.Connection internal class JsonRpcConnection : RemoteHostClient.Connection
{ {
// communication channel related to service information // communication channel related to service information
private readonly ServiceJsonRpcClient _serviceClient; private readonly ServiceJsonRpcEx _serviceRpc;
// communication channel related to snapshot information // communication channel related to snapshot information
private readonly RemotableDataJsonRpcEx _remoteDataRpc; private readonly RemotableDataJsonRpcEx _remoteDataRpc;
...@@ -21,14 +21,14 @@ internal class ServiceHubJsonRpcConnection : RemoteHostClient.Connection ...@@ -21,14 +21,14 @@ internal class ServiceHubJsonRpcConnection : RemoteHostClient.Connection
// close connection when cancellation has raised // close connection when cancellation has raised
private readonly CancellationTokenRegistration _cancellationRegistration; private readonly CancellationTokenRegistration _cancellationRegistration;
public ServiceHubJsonRpcConnection( public JsonRpcConnection(
object callbackTarget, object callbackTarget,
Stream serviceStream, Stream serviceStream,
RemotableDataJsonRpcEx dataRpc, RemotableDataJsonRpcEx dataRpc,
CancellationToken cancellationToken) : CancellationToken cancellationToken) :
base(cancellationToken) base(cancellationToken)
{ {
_serviceClient = new ServiceJsonRpcClient(serviceStream, callbackTarget, cancellationToken); _serviceRpc = new ServiceJsonRpcEx(serviceStream, callbackTarget, cancellationToken);
_remoteDataRpc = dataRpc; _remoteDataRpc = dataRpc;
// dispose session when cancellation has raised // dispose session when cancellation has raised
...@@ -37,27 +37,27 @@ internal class ServiceHubJsonRpcConnection : RemoteHostClient.Connection ...@@ -37,27 +37,27 @@ internal class ServiceHubJsonRpcConnection : RemoteHostClient.Connection
protected override async Task OnRegisterPinnedRemotableDataScopeAsync(PinnedRemotableDataScope scope) protected override async Task OnRegisterPinnedRemotableDataScopeAsync(PinnedRemotableDataScope scope)
{ {
await _serviceClient.InvokeAsync(WellKnownServiceHubServices.ServiceHubServiceBase_Initialize, scope.SolutionInfo).ConfigureAwait(false); await _serviceRpc.InvokeAsync(WellKnownServiceHubServices.ServiceHubServiceBase_Initialize, scope.SolutionInfo).ConfigureAwait(false);
} }
public override Task InvokeAsync(string targetName, params object[] arguments) public override Task InvokeAsync(string targetName, params object[] arguments)
{ {
return _serviceClient.InvokeAsync(targetName, arguments); return _serviceRpc.InvokeAsync(targetName, arguments);
} }
public override Task<T> InvokeAsync<T>(string targetName, params object[] arguments) public override Task<T> InvokeAsync<T>(string targetName, params object[] arguments)
{ {
return _serviceClient.InvokeAsync<T>(targetName, arguments); return _serviceRpc.InvokeAsync<T>(targetName, arguments);
} }
public override Task InvokeAsync(string targetName, IEnumerable<object> arguments, Func<Stream, CancellationToken, Task> funcWithDirectStreamAsync) public override Task InvokeAsync(string targetName, IEnumerable<object> arguments, Func<Stream, CancellationToken, Task> funcWithDirectStreamAsync)
{ {
return _serviceClient.InvokeAsync(targetName, arguments, funcWithDirectStreamAsync); return _serviceRpc.InvokeAsync(targetName, arguments, funcWithDirectStreamAsync);
} }
public override Task<T> InvokeAsync<T>(string targetName, IEnumerable<object> arguments, Func<Stream, CancellationToken, Task<T>> funcWithDirectStreamAsync) public override Task<T> InvokeAsync<T>(string targetName, IEnumerable<object> arguments, Func<Stream, CancellationToken, Task<T>> funcWithDirectStreamAsync)
{ {
return _serviceClient.InvokeAsync<T>(targetName, arguments, funcWithDirectStreamAsync); return _serviceRpc.InvokeAsync<T>(targetName, arguments, funcWithDirectStreamAsync);
} }
protected override void OnDisposed() protected override void OnDisposed()
...@@ -68,7 +68,7 @@ protected override void OnDisposed() ...@@ -68,7 +68,7 @@ protected override void OnDisposed()
_cancellationRegistration.Dispose(); _cancellationRegistration.Dispose();
// dispose service and snapshot channels // dispose service and snapshot channels
_serviceClient.Dispose(); _serviceRpc.Dispose();
_remoteDataRpc.Dispose(); _remoteDataRpc.Dispose();
} }
...@@ -77,11 +77,11 @@ protected override void OnDisposed() ...@@ -77,11 +77,11 @@ protected override void OnDisposed()
/// ///
/// this is the channel consumer of remote host client will playing with /// this is the channel consumer of remote host client will playing with
/// </summary> /// </summary>
private class ServiceJsonRpcClient : JsonRpcEx private class ServiceJsonRpcEx : JsonRpcEx
{ {
private readonly object _callbackTarget; private readonly object _callbackTarget;
public ServiceJsonRpcClient(Stream stream, object callbackTarget, CancellationToken cancellationToken) public ServiceJsonRpcEx(Stream stream, object callbackTarget, CancellationToken cancellationToken)
: base(stream, callbackTarget, useThisAsCallback: false, cancellationToken: cancellationToken) : base(stream, callbackTarget, useThisAsCallback: false, cancellationToken: cancellationToken)
{ {
// this one doesn't need cancellation token since it has nothing to cancel // this one doesn't need cancellation token since it has nothing to cancel
......
...@@ -127,7 +127,7 @@ public override async Task<Connection> TryCreateConnectionAsync(string serviceNa ...@@ -127,7 +127,7 @@ public override async Task<Connection> TryCreateConnectionAsync(string serviceNa
// this is what consumer actually use to communicate information // this is what consumer actually use to communicate information
var serviceStream = await RequestServiceAsync(_hubClient, serviceName, _hostGroup, _timeout, cancellationToken).ConfigureAwait(false); var serviceStream = await RequestServiceAsync(_hubClient, serviceName, _hostGroup, _timeout, cancellationToken).ConfigureAwait(false);
return new ServiceHubJsonRpcConnection(callbackTarget, serviceStream, _remotableDataRpc.Share(), cancellationToken); return new JsonRpcConnection(callbackTarget, serviceStream, _remotableDataRpc.Share(), cancellationToken);
} }
protected override void OnStarted() protected override void OnStarted()
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册