Skip to content

Commit e5e02bd

Browse files
authored
Cancellationmanager revamp (#527)
* rhino and arc fix usage * fix registration * fix the rest * use interface * don't use rhino layer if there is no name * formatting * add tests * formatting * add to local and move * Update OTEL to remove grpc dependency * Fix deprecated method * really fixed with no incremental builds for tests * Fix references and lock * Update nuggets
1 parent e9f3701 commit e5e02bd

File tree

92 files changed

+1814
-1355
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

92 files changed

+1814
-1355
lines changed

Build/Program.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -176,10 +176,10 @@ void RemoveDirectory(string d)
176176
Glob.Files(".", "**/*.Tests.csproj"),
177177
file =>
178178
{
179-
Run("dotnet", $"restore {file} --locked-mode");
179+
Run("dotnet", $"build {file} -c Release --no-incremental");
180180
Run(
181181
"dotnet",
182-
$"test {file} -c Release --no-restore --verbosity=minimal /p:AltCover=true /p:AltCoverAttributeFilter=ExcludeFromCodeCoverage /p:AltCoverVerbosity=Warning"
182+
$"test {file} -c Release --no-build --verbosity=minimal /p:AltCover=true /p:AltCoverAttributeFilter=ExcludeFromCodeCoverage /p:AltCoverVerbosity=Warning"
183183
);
184184
}
185185
);

Connectors/ArcGIS/Speckle.Connectors.ArcGIS3/Bindings/ArcGISReceiveBinding.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ namespace Speckle.Connectors.ArcGIS.Bindings;
1919
public sealed class ArcGISReceiveBinding : IReceiveBinding
2020
{
2121
public string Name { get; } = "receiveBinding";
22-
private readonly CancellationManager _cancellationManager;
22+
private readonly ICancellationManager _cancellationManager;
2323
private readonly DocumentModelStore _store;
2424
private readonly IServiceProvider _serviceProvider;
2525
private readonly IOperationProgressManager _operationProgressManager;
@@ -32,7 +32,7 @@ public sealed class ArcGISReceiveBinding : IReceiveBinding
3232
public ArcGISReceiveBinding(
3333
DocumentModelStore store,
3434
IBrowserBridge parent,
35-
CancellationManager cancellationManager,
35+
ICancellationManager cancellationManager,
3636
IServiceProvider serviceProvider,
3737
IOperationProgressManager operationProgressManager,
3838
ILogger<ArcGISReceiveBinding> logger,
@@ -60,7 +60,7 @@ public async Task Receive(string modelCardId)
6060
throw new InvalidOperationException("No download model card was found.");
6161
}
6262

63-
CancellationToken cancellationToken = _cancellationManager.InitCancellationTokenSource(modelCardId);
63+
using var cancellationItem = _cancellationManager.GetCancellationItem(modelCardId);
6464
using var scope = _serviceProvider.CreateScope();
6565
scope
6666
.ServiceProvider.GetRequiredService<IConverterSettingsStore<ArcGISConversionSettings>>()
@@ -76,8 +76,8 @@ public async Task Receive(string modelCardId)
7676
.ServiceProvider.GetRequiredService<ReceiveOperation>()
7777
.Execute(
7878
modelCard.GetReceiveInfo("ArcGIS"), // POC: get host app name from settings? same for GetSendInfo
79-
_operationProgressManager.CreateOperationProgressEventHandler(Parent, modelCardId, cancellationToken),
80-
cancellationToken
79+
_operationProgressManager.CreateOperationProgressEventHandler(Parent, modelCardId, cancellationItem.Token),
80+
cancellationItem.Token
8181
);
8282

8383
modelCard.BakedObjectIds = receiveOperationResults.BakedObjectIds.ToList();

Connectors/ArcGIS/Speckle.Connectors.ArcGIS3/Bindings/ArcGISSendBinding.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ public sealed class ArcGISSendBinding : ISendBinding
3939
private readonly DocumentModelStore _store;
4040
private readonly IServiceProvider _serviceProvider;
4141
private readonly List<ISendFilter> _sendFilters;
42-
private readonly CancellationManager _cancellationManager;
42+
private readonly ICancellationManager _cancellationManager;
4343
private readonly ISendConversionCache _sendConversionCache;
4444
private readonly IOperationProgressManager _operationProgressManager;
4545
private readonly ILogger<ArcGISSendBinding> _logger;
@@ -64,7 +64,7 @@ public ArcGISSendBinding(
6464
IBrowserBridge parent,
6565
IEnumerable<ISendFilter> sendFilters,
6666
IServiceProvider serviceProvider,
67-
CancellationManager cancellationManager,
67+
ICancellationManager cancellationManager,
6868
ISendConversionCache sendConversionCache,
6969
IOperationProgressManager operationProgressManager,
7070
ILogger<ArcGISSendBinding> logger,
@@ -372,7 +372,7 @@ public async Task Send(string modelCardId)
372372
throw new InvalidOperationException("No publish model card was found.");
373373
}
374374

375-
CancellationToken cancellationToken = _cancellationManager.InitCancellationTokenSource(modelCardId);
375+
using var cancellationItem = _cancellationManager.GetCancellationItem(modelCardId);
376376

377377
using var scope = _serviceProvider.CreateScope();
378378
scope
@@ -415,8 +415,8 @@ public async Task Send(string modelCardId)
415415
.Execute(
416416
mapMembers,
417417
modelCard.GetSendInfo("ArcGIS"), // POC: get host app name from settings? same for GetReceiveInfo
418-
_operationProgressManager.CreateOperationProgressEventHandler(Parent, modelCardId, cancellationToken),
419-
cancellationToken
418+
_operationProgressManager.CreateOperationProgressEventHandler(Parent, modelCardId, cancellationItem.Token),
419+
cancellationItem.Token
420420
);
421421

422422
await Commands.SetModelSendResult(modelCardId, sendResult.RootObjId, sendResult.ConversionResults);

Connectors/ArcGIS/Speckle.Connectors.ArcGIS3/packages.lock.json

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -226,18 +226,18 @@
226226
"dependencies": {
227227
"Microsoft.Extensions.DependencyInjection": "[2.2.0, )",
228228
"Speckle.Connectors.Logging": "[1.0.0, )",
229-
"Speckle.Objects": "[3.1.0-dev.249, )",
230-
"Speckle.Sdk": "[3.1.0-dev.249, )",
231-
"Speckle.Sdk.Dependencies": "[3.1.0-dev.249, )"
229+
"Speckle.Objects": "[3.1.0-dev.251, )",
230+
"Speckle.Sdk": "[3.1.0-dev.251, )",
231+
"Speckle.Sdk.Dependencies": "[3.1.0-dev.251, )"
232232
}
233233
},
234234
"speckle.connectors.dui": {
235235
"type": "Project",
236236
"dependencies": {
237237
"Microsoft.Extensions.Logging.Abstractions": "[2.2.0, )",
238238
"Speckle.Connectors.Common": "[1.0.0, )",
239-
"Speckle.Sdk": "[3.1.0-dev.249, )",
240-
"Speckle.Sdk.Dependencies": "[3.1.0-dev.249, )"
239+
"Speckle.Sdk": "[3.1.0-dev.251, )",
240+
"Speckle.Sdk.Dependencies": "[3.1.0-dev.251, )"
241241
}
242242
},
243243
"speckle.connectors.dui.webview": {
@@ -261,7 +261,7 @@
261261
"type": "Project",
262262
"dependencies": {
263263
"Microsoft.Extensions.Logging.Abstractions": "[2.2.0, )",
264-
"Speckle.Objects": "[3.1.0-dev.249, )"
264+
"Speckle.Objects": "[3.1.0-dev.251, )"
265265
}
266266
},
267267
"Microsoft.Extensions.DependencyInjection": {
@@ -299,18 +299,18 @@
299299
},
300300
"Speckle.Objects": {
301301
"type": "CentralTransitive",
302-
"requested": "[3.1.0-dev.249, )",
303-
"resolved": "3.1.0-dev.249",
304-
"contentHash": "PoBE+8+q16PGCqdl1WMUqHIV55H7wxzl0g5OHuriZRE4dQr34R4TpNCHVT1M7U5yZzpKPdxRwc6GAIKCfmh8/Q==",
302+
"requested": "[3.1.0-dev.251, )",
303+
"resolved": "3.1.0-dev.251",
304+
"contentHash": "p3fXmlqoKGCRKuo2Z15JrpPhVSTeUG5jSliLlq1mHQBGLwei93mXORJnJYxPcTR5QPzKbCyRnYjqcUknsghxXQ==",
305305
"dependencies": {
306-
"Speckle.Sdk": "3.1.0-dev.249"
306+
"Speckle.Sdk": "3.1.0-dev.251"
307307
}
308308
},
309309
"Speckle.Sdk": {
310310
"type": "CentralTransitive",
311-
"requested": "[3.1.0-dev.249, )",
312-
"resolved": "3.1.0-dev.249",
313-
"contentHash": "ebSNFseiz4Htkwosh7hbdUALXEnOR3AoBWFOg59wSnb/PmbOretRw2BkeUt3dA2v1Errwg5jqJwU2CrkqU3NwA==",
311+
"requested": "[3.1.0-dev.251, )",
312+
"resolved": "3.1.0-dev.251",
313+
"contentHash": "ycwfr6+TRfS5XdYpALpKFxs2VFV/kvRYdfKWEw01Qtg2NaGGpnQzINfFzh72Jbi5XoH1RZt2dPDdNwJbpSsG0A==",
314314
"dependencies": {
315315
"GraphQL.Client": "6.0.0",
316316
"Microsoft.Bcl.AsyncInterfaces": "[5.0.0]",
@@ -320,14 +320,14 @@
320320
"Microsoft.Extensions.Logging": "[2.2.0]",
321321
"Speckle.DoubleNumerics": "4.0.1",
322322
"Speckle.Newtonsoft.Json": "13.0.2",
323-
"Speckle.Sdk.Dependencies": "3.1.0-dev.249"
323+
"Speckle.Sdk.Dependencies": "3.1.0-dev.251"
324324
}
325325
},
326326
"Speckle.Sdk.Dependencies": {
327327
"type": "CentralTransitive",
328-
"requested": "[3.1.0-dev.249, )",
329-
"resolved": "3.1.0-dev.249",
330-
"contentHash": "rQrawSfqMl/dgMglWibH6VmsosN6yImjzTzNg52dpTF0lMjaU05ZVL7vQ1lwl5up7iOFnPgGARILyl49XV8Zsw=="
328+
"requested": "[3.1.0-dev.251, )",
329+
"resolved": "3.1.0-dev.251",
330+
"contentHash": "M8MNH+yeIkEmhnb4GxrKyewCotaP+MZ+FUbkuHDaMbnG7xbJ0Y83nDA7v77v2v/UczCFmdVqroFnV4i6OQew7g=="
331331
}
332332
},
333333
"net6.0-windows7.0/win-x64": {

Connectors/Autocad/Speckle.Connectors.Autocad2022/packages.lock.json

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -259,18 +259,18 @@
259259
"dependencies": {
260260
"Microsoft.Extensions.DependencyInjection": "[2.2.0, )",
261261
"Speckle.Connectors.Logging": "[1.0.0, )",
262-
"Speckle.Objects": "[3.1.0-dev.249, )",
263-
"Speckle.Sdk": "[3.1.0-dev.249, )",
264-
"Speckle.Sdk.Dependencies": "[3.1.0-dev.249, )"
262+
"Speckle.Objects": "[3.1.0-dev.251, )",
263+
"Speckle.Sdk": "[3.1.0-dev.251, )",
264+
"Speckle.Sdk.Dependencies": "[3.1.0-dev.251, )"
265265
}
266266
},
267267
"speckle.connectors.dui": {
268268
"type": "Project",
269269
"dependencies": {
270270
"Microsoft.Extensions.Logging.Abstractions": "[2.2.0, )",
271271
"Speckle.Connectors.Common": "[1.0.0, )",
272-
"Speckle.Sdk": "[3.1.0-dev.249, )",
273-
"Speckle.Sdk.Dependencies": "[3.1.0-dev.249, )"
272+
"Speckle.Sdk": "[3.1.0-dev.251, )",
273+
"Speckle.Sdk.Dependencies": "[3.1.0-dev.251, )"
274274
}
275275
},
276276
"speckle.connectors.dui.webview": {
@@ -294,7 +294,7 @@
294294
"type": "Project",
295295
"dependencies": {
296296
"Microsoft.Extensions.Logging.Abstractions": "[2.2.0, )",
297-
"Speckle.Objects": "[3.1.0-dev.249, )"
297+
"Speckle.Objects": "[3.1.0-dev.251, )"
298298
}
299299
},
300300
"Microsoft.Extensions.DependencyInjection": {
@@ -338,18 +338,18 @@
338338
},
339339
"Speckle.Objects": {
340340
"type": "CentralTransitive",
341-
"requested": "[3.1.0-dev.249, )",
342-
"resolved": "3.1.0-dev.249",
343-
"contentHash": "PoBE+8+q16PGCqdl1WMUqHIV55H7wxzl0g5OHuriZRE4dQr34R4TpNCHVT1M7U5yZzpKPdxRwc6GAIKCfmh8/Q==",
341+
"requested": "[3.1.0-dev.251, )",
342+
"resolved": "3.1.0-dev.251",
343+
"contentHash": "p3fXmlqoKGCRKuo2Z15JrpPhVSTeUG5jSliLlq1mHQBGLwei93mXORJnJYxPcTR5QPzKbCyRnYjqcUknsghxXQ==",
344344
"dependencies": {
345-
"Speckle.Sdk": "3.1.0-dev.249"
345+
"Speckle.Sdk": "3.1.0-dev.251"
346346
}
347347
},
348348
"Speckle.Sdk": {
349349
"type": "CentralTransitive",
350-
"requested": "[3.1.0-dev.249, )",
351-
"resolved": "3.1.0-dev.249",
352-
"contentHash": "ebSNFseiz4Htkwosh7hbdUALXEnOR3AoBWFOg59wSnb/PmbOretRw2BkeUt3dA2v1Errwg5jqJwU2CrkqU3NwA==",
350+
"requested": "[3.1.0-dev.251, )",
351+
"resolved": "3.1.0-dev.251",
352+
"contentHash": "ycwfr6+TRfS5XdYpALpKFxs2VFV/kvRYdfKWEw01Qtg2NaGGpnQzINfFzh72Jbi5XoH1RZt2dPDdNwJbpSsG0A==",
353353
"dependencies": {
354354
"GraphQL.Client": "6.0.0",
355355
"Microsoft.Bcl.AsyncInterfaces": "[5.0.0]",
@@ -359,14 +359,14 @@
359359
"Microsoft.Extensions.Logging": "[2.2.0]",
360360
"Speckle.DoubleNumerics": "4.0.1",
361361
"Speckle.Newtonsoft.Json": "13.0.2",
362-
"Speckle.Sdk.Dependencies": "3.1.0-dev.249"
362+
"Speckle.Sdk.Dependencies": "3.1.0-dev.251"
363363
}
364364
},
365365
"Speckle.Sdk.Dependencies": {
366366
"type": "CentralTransitive",
367-
"requested": "[3.1.0-dev.249, )",
368-
"resolved": "3.1.0-dev.249",
369-
"contentHash": "rQrawSfqMl/dgMglWibH6VmsosN6yImjzTzNg52dpTF0lMjaU05ZVL7vQ1lwl5up7iOFnPgGARILyl49XV8Zsw=="
367+
"requested": "[3.1.0-dev.251, )",
368+
"resolved": "3.1.0-dev.251",
369+
"contentHash": "M8MNH+yeIkEmhnb4GxrKyewCotaP+MZ+FUbkuHDaMbnG7xbJ0Y83nDA7v77v2v/UczCFmdVqroFnV4i6OQew7g=="
370370
}
371371
}
372372
}

Connectors/Autocad/Speckle.Connectors.Autocad2023/packages.lock.json

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -259,18 +259,18 @@
259259
"dependencies": {
260260
"Microsoft.Extensions.DependencyInjection": "[2.2.0, )",
261261
"Speckle.Connectors.Logging": "[1.0.0, )",
262-
"Speckle.Objects": "[3.1.0-dev.249, )",
263-
"Speckle.Sdk": "[3.1.0-dev.249, )",
264-
"Speckle.Sdk.Dependencies": "[3.1.0-dev.249, )"
262+
"Speckle.Objects": "[3.1.0-dev.251, )",
263+
"Speckle.Sdk": "[3.1.0-dev.251, )",
264+
"Speckle.Sdk.Dependencies": "[3.1.0-dev.251, )"
265265
}
266266
},
267267
"speckle.connectors.dui": {
268268
"type": "Project",
269269
"dependencies": {
270270
"Microsoft.Extensions.Logging.Abstractions": "[2.2.0, )",
271271
"Speckle.Connectors.Common": "[1.0.0, )",
272-
"Speckle.Sdk": "[3.1.0-dev.249, )",
273-
"Speckle.Sdk.Dependencies": "[3.1.0-dev.249, )"
272+
"Speckle.Sdk": "[3.1.0-dev.251, )",
273+
"Speckle.Sdk.Dependencies": "[3.1.0-dev.251, )"
274274
}
275275
},
276276
"speckle.connectors.dui.webview": {
@@ -294,7 +294,7 @@
294294
"type": "Project",
295295
"dependencies": {
296296
"Microsoft.Extensions.Logging.Abstractions": "[2.2.0, )",
297-
"Speckle.Objects": "[3.1.0-dev.249, )"
297+
"Speckle.Objects": "[3.1.0-dev.251, )"
298298
}
299299
},
300300
"Microsoft.Extensions.DependencyInjection": {
@@ -338,18 +338,18 @@
338338
},
339339
"Speckle.Objects": {
340340
"type": "CentralTransitive",
341-
"requested": "[3.1.0-dev.249, )",
342-
"resolved": "3.1.0-dev.249",
343-
"contentHash": "PoBE+8+q16PGCqdl1WMUqHIV55H7wxzl0g5OHuriZRE4dQr34R4TpNCHVT1M7U5yZzpKPdxRwc6GAIKCfmh8/Q==",
341+
"requested": "[3.1.0-dev.251, )",
342+
"resolved": "3.1.0-dev.251",
343+
"contentHash": "p3fXmlqoKGCRKuo2Z15JrpPhVSTeUG5jSliLlq1mHQBGLwei93mXORJnJYxPcTR5QPzKbCyRnYjqcUknsghxXQ==",
344344
"dependencies": {
345-
"Speckle.Sdk": "3.1.0-dev.249"
345+
"Speckle.Sdk": "3.1.0-dev.251"
346346
}
347347
},
348348
"Speckle.Sdk": {
349349
"type": "CentralTransitive",
350-
"requested": "[3.1.0-dev.249, )",
351-
"resolved": "3.1.0-dev.249",
352-
"contentHash": "ebSNFseiz4Htkwosh7hbdUALXEnOR3AoBWFOg59wSnb/PmbOretRw2BkeUt3dA2v1Errwg5jqJwU2CrkqU3NwA==",
350+
"requested": "[3.1.0-dev.251, )",
351+
"resolved": "3.1.0-dev.251",
352+
"contentHash": "ycwfr6+TRfS5XdYpALpKFxs2VFV/kvRYdfKWEw01Qtg2NaGGpnQzINfFzh72Jbi5XoH1RZt2dPDdNwJbpSsG0A==",
353353
"dependencies": {
354354
"GraphQL.Client": "6.0.0",
355355
"Microsoft.Bcl.AsyncInterfaces": "[5.0.0]",
@@ -359,14 +359,14 @@
359359
"Microsoft.Extensions.Logging": "[2.2.0]",
360360
"Speckle.DoubleNumerics": "4.0.1",
361361
"Speckle.Newtonsoft.Json": "13.0.2",
362-
"Speckle.Sdk.Dependencies": "3.1.0-dev.249"
362+
"Speckle.Sdk.Dependencies": "3.1.0-dev.251"
363363
}
364364
},
365365
"Speckle.Sdk.Dependencies": {
366366
"type": "CentralTransitive",
367-
"requested": "[3.1.0-dev.249, )",
368-
"resolved": "3.1.0-dev.249",
369-
"contentHash": "rQrawSfqMl/dgMglWibH6VmsosN6yImjzTzNg52dpTF0lMjaU05ZVL7vQ1lwl5up7iOFnPgGARILyl49XV8Zsw=="
367+
"requested": "[3.1.0-dev.251, )",
368+
"resolved": "3.1.0-dev.251",
369+
"contentHash": "M8MNH+yeIkEmhnb4GxrKyewCotaP+MZ+FUbkuHDaMbnG7xbJ0Y83nDA7v77v2v/UczCFmdVqroFnV4i6OQew7g=="
370370
}
371371
}
372372
}

0 commit comments

Comments
 (0)