Feature/connect cancel (#74)

* Implemented connection cancellation

* Made connect requests return immediately and created a separate connection complete notification

* Fix spelling

* Fix sorting

* Add separate lock for cancellation source map
This commit is contained in:
Mitchell Sternke
2016-10-04 15:45:52 -07:00
committed by GitHub
parent 62525b9c98
commit 8408bc6dff
17 changed files with 532 additions and 98 deletions

View File

@@ -0,0 +1,19 @@
//
// Copyright (c) Microsoft. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
//
namespace Microsoft.SqlTools.ServiceLayer.Connection.Contracts
{
/// <summary>
/// Parameters for the Cancel Connect Request.
/// </summary>
public class CancelConnectParams
{
/// <summary>
/// A URI identifying the owner of the connection. This will most commonly be a file in the workspace
/// or a virtual file representing an object in a database.
/// </summary>
public string OwnerUri { get; set; }
}
}

View File

@@ -0,0 +1,19 @@
//
// Copyright (c) Microsoft. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
//
using Microsoft.SqlTools.ServiceLayer.Hosting.Protocol.Contracts;
namespace Microsoft.SqlTools.ServiceLayer.Connection.Contracts
{
/// <summary>
/// Cancel connect request mapping entry
/// </summary>
public class CancelConnectRequest
{
public static readonly
RequestType<CancelConnectParams, bool> Type =
RequestType<CancelConnectParams, bool>.Create("connection/cancelconnect");
}
}

View File

@@ -3,13 +3,21 @@
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
//
using Microsoft.SqlTools.ServiceLayer.Hosting.Protocol.Contracts;
namespace Microsoft.SqlTools.ServiceLayer.Connection.Contracts
{
/// <summary>
/// Message format for the connection result response
/// Parameters to be sent back with a connection complete event
/// </summary>
public class ConnectResponse
public class ConnectionCompleteParams
{
/// <summary>
/// A URI identifying the owner of the connection. This will most commonly be a file in the workspace
/// or a virtual file representing an object in a database.
/// </summary>
public string OwnerUri { get; set; }
/// <summary>
/// A GUID representing a unique connection ID
/// </summary>
@@ -40,4 +48,14 @@ namespace Microsoft.SqlTools.ServiceLayer.Connection.Contracts
/// </summary>
public ConnectionSummary ConnectionSummary { get; set; }
}
/// <summary>
/// ConnectionComplete notification mapping entry
/// </summary>
public class ConnectionCompleteNotification
{
public static readonly
EventType<ConnectionCompleteParams> Type =
EventType<ConnectionCompleteParams>.Create("connection/complete");
}
}

View File

@@ -13,7 +13,7 @@ namespace Microsoft.SqlTools.ServiceLayer.Connection.Contracts
public class ConnectionRequest
{
public static readonly
RequestType<ConnectParams, ConnectResponse> Type =
RequestType<ConnectParams, ConnectResponse>.Create("connection/connect");
RequestType<ConnectParams, bool> Type =
RequestType<ConnectParams, bool>.Create("connection/connect");
}
}