add a flag to make message processing parallel (#1482)

* add a flag to make message processing parallel

* use discard

* add comment
This commit is contained in:
Alan Ren
2022-05-05 14:44:58 -07:00
committed by GitHub
parent b7360ea17f
commit a7e6eca9e3
4 changed files with 51 additions and 18 deletions

View File

@@ -45,6 +45,7 @@ namespace Microsoft.SqlTools.ServiceLayer
SqlToolsContext sqlToolsContext = new SqlToolsContext(hostDetails);
ServiceHost serviceHost = HostLoader.CreateAndStartServiceHost(sqlToolsContext);
serviceHost.MessageDispatcher.ParallelMessageProcessing = commandOptions.ParallelMessageProcessing;
// If this service was started by another process, then it should shutdown when that parent process does.
if (commandOptions.ParentProcessId != null)
@@ -58,9 +59,9 @@ namespace Microsoft.SqlTools.ServiceLayer
}
catch (Exception ex)
{
try
try
{
Logger.WriteWithCallstack(TraceEventType.Critical, $"An unhandled exception occurred: {ex}");
Logger.WriteWithCallstack(TraceEventType.Critical, $"An unhandled exception occurred: {ex}");
}
catch (Exception loggerEx)
{