mirror of
https://github.com/ckaczor/sqltoolsservice.git
synced 2026-02-11 02:32:40 -05:00
Re-enable parallel message processing (#1741)
* add flag to handler * cleanup * concurrency control * add flag for handler setters * update service flags * fix event handlers * more handlers * make sure behavior is unchanged if flag is off * cleanup * add test case for parallel processing * comments * stop dispatcher in test * add log for request lifespan * cleanup and add comments * correctly release semaphore * remove deleted file from merge * use await for semaphore release * move handler invocation to await and adjust test * cleanup exception handling and wrapper * space * loose assertion condition to make test stable
This commit is contained in:
@@ -272,32 +272,39 @@ namespace Microsoft.SqlTools.Hosting.Protocol
|
||||
|
||||
public void SetRequestHandler<TParams, TResult>(
|
||||
RequestType<TParams, TResult> requestType,
|
||||
Func<TParams, RequestContext<TResult>, Task> requestHandler)
|
||||
Func<TParams, RequestContext<TResult>, Task> requestHandler,
|
||||
bool isParallelProcessingSupported = false)
|
||||
{
|
||||
this.MessageDispatcher.SetRequestHandler(
|
||||
requestType,
|
||||
requestHandler);
|
||||
}
|
||||
|
||||
public void SetEventHandler<TParams>(
|
||||
EventType<TParams> eventType,
|
||||
Func<TParams, EventContext, Task> eventHandler)
|
||||
{
|
||||
this.MessageDispatcher.SetEventHandler(
|
||||
eventType,
|
||||
eventHandler,
|
||||
false);
|
||||
requestHandler,
|
||||
false,
|
||||
isParallelProcessingSupported);
|
||||
}
|
||||
|
||||
public void SetEventHandler<TParams>(
|
||||
EventType<TParams> eventType,
|
||||
Func<TParams, EventContext, Task> eventHandler,
|
||||
bool overrideExisting)
|
||||
bool isParallelProcessingSupported = false)
|
||||
{
|
||||
this.MessageDispatcher.SetEventHandler(
|
||||
eventType,
|
||||
eventHandler,
|
||||
overrideExisting);
|
||||
false,
|
||||
isParallelProcessingSupported);
|
||||
}
|
||||
|
||||
public void SetEventHandler<TParams>(
|
||||
EventType<TParams> eventType,
|
||||
Func<TParams, EventContext, Task> eventHandler,
|
||||
bool overrideExisting,
|
||||
bool isParallelProcessingSupported = false)
|
||||
{
|
||||
this.MessageDispatcher.SetEventHandler(
|
||||
eventType,
|
||||
eventHandler,
|
||||
overrideExisting,
|
||||
isParallelProcessingSupported);
|
||||
}
|
||||
|
||||
private void HandleResponse(Message responseMessage)
|
||||
|
||||
Reference in New Issue
Block a user