mirror of
https://github.com/ckaczor/sqltoolsservice.git
synced 2026-01-16 01:25:41 -05:00
Batch Start Notification (#169)
This change is part of the progressive results code. It will submit a notification from the service layer to indicate when execution of a batch has completed. This notification will contain the selection for batch, execution start time, and its ID. This will enable the extension to produce a header for the batch before the batch completes, in order to make it more clear to the user that execution is going on. * Adding new event for batch start * Unit tests * Fixing comments as per @kevcunnane
This commit is contained in:
@@ -443,17 +443,28 @@ namespace Microsoft.SqlTools.ServiceLayer.QueryExecution
|
||||
query.QueryFailed += callback;
|
||||
query.QueryConnectionException += errorCallback;
|
||||
|
||||
// Setup the batch completion callback
|
||||
Batch.BatchAsyncEventHandler batchCallback = async b =>
|
||||
// Setup the batch callbacks
|
||||
Batch.BatchAsyncEventHandler batchStartCallback = async b =>
|
||||
{
|
||||
QueryExecuteBatchCompleteParams eventParams = new QueryExecuteBatchCompleteParams
|
||||
QueryExecuteBatchNotificationParams eventParams = new QueryExecuteBatchNotificationParams
|
||||
{
|
||||
BatchSummary = b.Summary,
|
||||
OwnerUri = executeParams.OwnerUri
|
||||
};
|
||||
await requestContext.SendEvent(QueryExecuteBatchStartEvent.Type, eventParams);
|
||||
};
|
||||
query.BatchStarted += batchStartCallback;
|
||||
|
||||
Batch.BatchAsyncEventHandler batchCompleteCallback = async b =>
|
||||
{
|
||||
QueryExecuteBatchNotificationParams eventParams = new QueryExecuteBatchNotificationParams
|
||||
{
|
||||
BatchSummary = b.Summary,
|
||||
OwnerUri = executeParams.OwnerUri
|
||||
};
|
||||
await requestContext.SendEvent(QueryExecuteBatchCompleteEvent.Type, eventParams);
|
||||
};
|
||||
query.BatchCompleted += batchCallback;
|
||||
query.BatchCompleted += batchCompleteCallback;
|
||||
|
||||
// Setup the ResultSet completion callback
|
||||
ResultSet.ResultSetAsyncEventHandler resultCallback = async r =>
|
||||
|
||||
Reference in New Issue
Block a user