From 1fd315a1a55b9afd721fe096a6cea65bcb066dbb Mon Sep 17 00:00:00 2001 From: Calvin Wilkinson <85414302+CalvinWilkinson@users.noreply.github.com> Date: Mon, 22 Jan 2024 17:55:26 +0000 Subject: [PATCH] =?UTF-8?q?=F0=9F=9A=A7Improve=20subscriptions=20and=20sub?= =?UTF-8?q?scription=20ids=20(#191)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Start work for issue #187 * refactor!: renamed method parameters to id * perf: cleanup and improve perf project * config: cleanup and improve solution configs asdf * ide: add word to dictionary for vscode users * ci: add deno permission * ide: update run/debug configs for rider * perf: refactored array check for to use TrueForAll instead of All * refactor!: change the Subscriptions property type * perf: improve perf of push reactable push method * perf: improve perf of pull reactable pull method * chore: suppress warning * ide: suppress warning in solution level editor config * chore: add using statements * chore: perf project improvements * perf: setup and collect perf data on non directional push reactable * perf: improve perf of push & pull reactable PushPull method * config: create run/debug config for push pull reactable perf test * perf: setup and collect perf data on two way push pull reactable * perf: adjust table * chore: move error notification processing to base class * fix: fix error processing in the two way push pull reactable * fix: fix error processing in the one way pull reactable * test: add tests * refactor: simple code layout changes * tests: add and improve tests * ide,test,config: exclude samples project from code coverage results * cleanup: remove unused usings * fix: fix issue with pull notification being allowed after disposal * fix: fix issue with push pull notification being allowed after disposal * perf: improve perf of on error processing * perf: improve perf of unsubscribe process * refactor!: swapped the parameters for the 'Push' and 'PushPull' methods * docs: update param name in readme code block --- .editorconfig | 1 + .github/workflows/sync-bot.yml | 2 +- .run/CarbonatePerfTests.run.xml | 6 +- .run/Samples.run.xml | 8 +- .vscode/settings.json | 1 + Carbonate.sln | 74 ++++++++++++------- Carbonate.sln.DotSettings | 1 + Carbonate/Carbonate.csproj | 2 +- Carbonate/Core/IReactable.cs | 3 +- Carbonate/Core/SubscriptionUnsubscriber.cs | 5 +- Carbonate/Fluent/SubscriptionBuilder.cs | 8 +- Carbonate/NonDirectional/IPushable.cs | 6 +- Carbonate/NonDirectional/PushReactable.cs | 61 ++------------- Carbonate/OneWay/IPullable.cs | 6 +- Carbonate/OneWay/IPushable.cs | 6 +- Carbonate/OneWay/PullReactable.cs | 28 ++++--- Carbonate/OneWay/PushReactable.cs | 61 ++------------- Carbonate/ReactableBase.cs | 74 ++++++++++--------- Carbonate/SubscriptionBase.cs | 2 +- Carbonate/TwoWay/IPushablePullable.cs | 6 +- Carbonate/TwoWay/PushPullReactable.cs | 25 +++++-- .../TwoWay/ReceiveRespondSubscription.cs | 2 +- README.md | 2 +- .../Samples/OneWayWithoutFluentApiSample.cs | 2 +- Samples/Samples/Program.cs | 2 + Samples/Samples/Samples.csproj | 2 + Samples/Samples/TwoWayWithoutFluentApi.cs | 8 +- .../CarbonateIntegrationTests.csproj | 2 +- ...ableWithoutDataGoingIn_IntegrationTests.cs | 4 +- ...hPullReactableWithData_IntegrationTests.cs | 2 +- .../Benchmarks/NonDir_PushReactable_Class.cs | 40 ++++++++++ .../Benchmarks/OneWay_PullReactable_Class.cs | 60 +++++++++++++++ .../Benchmarks/OneWay_PushReactable_Class.cs | 60 +++++++++++++++ .../Benchmarks/PullReactable_Class.cs | 50 ------------- .../TwoWay_PushPullReactable_Class.cs | 60 +++++++++++++++ .../CarbonatePerfTests.csproj | 17 ++++- Testing/CarbonatePerfTests/DataItemResult.cs | 16 ---- Testing/CarbonatePerfTests/DataResult.cs | 16 ---- Testing/CarbonatePerfTests/Ids.cs | 16 ---- .../MemPerfs/MemPerfRunner.cs | 57 -------------- .../MemPerfs/PerfScenarios.cs | 26 ------- .../PrefResults/NonDirPushreactable.md | 23 ++++++ .../PrefResults/OneWayPullReactable.md | 30 ++++++++ .../PrefResults/OneWayPushReactable.md | 30 ++++++++ .../PrefResults/TwoWayPushPullReactable.md | 30 ++++++++ Testing/CarbonatePerfTests/Program.cs | 64 +++++++++------- Testing/CarbonatePerfTests/PtrDataPuller.cs | 28 ------- Testing/CarbonatePerfTests/PtrDataStore.cs | 44 ----------- .../CarbonatePerfTests/StructDataPuller.cs | 22 ------ Testing/CarbonatePerfTests/StructDataStore.cs | 37 ---------- Testing/CarbonatePerfTests/StructItem.cs | 2 - Testing/CarbonateTests/CarbonateTests.csproj | 2 +- .../Fluent/ReactableBuilderTests.cs | 36 +++++++++ .../Fluent/SubscriptionBuilderTests.cs | 36 +++++++++ .../OneWay/PullReactableTests.cs | 36 +++++++++ .../OneWay/PushReactableTests.cs | 10 +-- .../OneWay/RespondSubscriptionTests.cs | 2 +- .../ReactableExtensionMethodsTests.cs | 39 ++++++++++ .../CarbonateTests/SubscriptionBaseTests.cs | 29 ++++++++ .../TwoWay/PushPullReactableTests.cs | 40 +++++++++- .../TwoWay/ReceiveRespondSubscriptionTests.cs | 16 +++- 61 files changed, 806 insertions(+), 580 deletions(-) create mode 100644 Testing/CarbonatePerfTests/Benchmarks/NonDir_PushReactable_Class.cs create mode 100644 Testing/CarbonatePerfTests/Benchmarks/OneWay_PullReactable_Class.cs create mode 100644 Testing/CarbonatePerfTests/Benchmarks/OneWay_PushReactable_Class.cs delete mode 100644 Testing/CarbonatePerfTests/Benchmarks/PullReactable_Class.cs create mode 100644 Testing/CarbonatePerfTests/Benchmarks/TwoWay_PushPullReactable_Class.cs delete mode 100644 Testing/CarbonatePerfTests/DataItemResult.cs delete mode 100644 Testing/CarbonatePerfTests/DataResult.cs delete mode 100644 Testing/CarbonatePerfTests/Ids.cs delete mode 100644 Testing/CarbonatePerfTests/MemPerfs/MemPerfRunner.cs delete mode 100644 Testing/CarbonatePerfTests/MemPerfs/PerfScenarios.cs create mode 100644 Testing/CarbonatePerfTests/PrefResults/NonDirPushreactable.md create mode 100644 Testing/CarbonatePerfTests/PrefResults/OneWayPullReactable.md create mode 100644 Testing/CarbonatePerfTests/PrefResults/OneWayPushReactable.md create mode 100644 Testing/CarbonatePerfTests/PrefResults/TwoWayPushPullReactable.md delete mode 100644 Testing/CarbonatePerfTests/PtrDataPuller.cs delete mode 100644 Testing/CarbonatePerfTests/PtrDataStore.cs delete mode 100644 Testing/CarbonatePerfTests/StructDataPuller.cs delete mode 100644 Testing/CarbonatePerfTests/StructDataStore.cs diff --git a/.editorconfig b/.editorconfig index 4d84934..fb8a5f9 100644 --- a/.editorconfig +++ b/.editorconfig @@ -153,6 +153,7 @@ csharp_space_around_binary_operators = before_and_after csharp_space_between_method_declaration_empty_parameter_list_parentheses = false csharp_space_between_method_call_name_and_opening_parenthesis = false csharp_space_between_method_call_empty_parameter_list_parentheses = false +dotnet_diagnostic.SA1010.severity = none # Wrapping preferences csharp_preserve_single_line_blocks = true diff --git a/.github/workflows/sync-bot.yml b/.github/workflows/sync-bot.yml index d2e000f..540ec6c 100644 --- a/.github/workflows/sync-bot.yml +++ b/.github/workflows/sync-bot.yml @@ -44,7 +44,7 @@ jobs: 5. PAT #> deno run ` - --allow-net ` + --allow-net -allow-read ` "$scriptUrl" ` "${{ vars.ORGANIZATION_NAME }}" ` "${{ vars.PROJECT_NAME }}" ` diff --git a/.run/CarbonatePerfTests.run.xml b/.run/CarbonatePerfTests.run.xml index 846f939..9f3c4a4 100644 --- a/.run/CarbonatePerfTests.run.xml +++ b/.run/CarbonatePerfTests.run.xml @@ -1,8 +1,8 @@ -