From 4f823d7f35e4f63fba7db0428b9106ef88d1c9b6 Mon Sep 17 00:00:00 2001 From: Tomasz Jaskula Date: Thu, 22 Apr 2021 21:33:16 +0200 Subject: [PATCH] Change namespace to Vlingo.Xoom.Common and adjusting imports --- src/Vlingo.Actors.Tests/ActorLifecycleTest.cs | 30 ++--- src/Vlingo.Actors.Tests/ActorStopTest.cs | 68 +++++------ .../ActorStowDisperseTest.cs | 44 +++---- .../AnswerEventuallyTest.cs | 6 +- .../BroadcastRouterTest.cs | 2 +- src/Vlingo.Actors.Tests/CharactersTest.cs | 2 +- .../CompletesActorProtocolTest.cs | 2 +- src/Vlingo.Actors.Tests/GuidAddressTest.cs | 4 +- src/Vlingo.Actors.Tests/LocalMessageTest.cs | 2 +- src/Vlingo.Actors.Tests/MockCompletes.cs | 24 ++-- .../Completes/MockCompletesEventually.cs | 2 +- .../MockCompletesEventuallyProvider.cs | 2 +- .../Plugin/Completes/MockRegistrar.cs | 5 +- .../Completes/PooledCompletesPluginTest.cs | 2 +- ...ToOneConcurrentArrayQueueDispatcherTest.cs | 2 +- ...OneConcurrentArrayQueueMailboxActorTest.cs | 2 +- .../ConcurrentQueue/ExecutorDispatcherTest.cs | 67 ++++++----- ...iesFileConfigRingBufferMailboxActorTest.cs | 19 ++- .../RingBufferDispatcherTest.cs | 2 +- .../RingBufferMailboxActorTest.cs | 2 +- src/Vlingo.Actors.Tests/RandomRouterTest.cs | 23 ++-- .../RoundRobinRouterTest.cs | 14 +-- src/Vlingo.Actors.Tests/SchedulerTest.cs | 16 +-- src/Vlingo.Actors.Tests/StageTest.cs | 2 +- .../Supervision/BasicSupervisionTest.cs | 2 +- .../Supervision/EscalateSupervisorActor.cs | 11 +- .../Supervision/FailureControlActor.cs | 2 +- .../Supervision/PingActor.cs | 10 +- .../Supervision/PingSupervisorActor.cs | 2 +- .../Supervision/PongActor.cs | 10 +- .../Supervision/PongSupervisorActor.cs | 2 +- .../RestartFiveInOneSupervisorActor.cs | 2 +- .../RestartForeverSupervisorActor.cs | 2 +- .../ResumeForeverSupervisorActor.cs | 13 +-- .../Supervision/StopAllSupervisorActor.cs | 8 +- .../SuspendedSenderSupervisorActor.cs | 26 ++--- .../TaskActorProtocolTest.cs | 2 +- src/Vlingo.Actors.Tests/WorldTest.cs | 2 +- src/Vlingo.Actors/Actor.cs | 2 +- src/Vlingo.Actors/BasicAddressFactory.cs | 2 +- src/Vlingo.Actors/BroadcastRouter.cs | 2 +- src/Vlingo.Actors/Cancellable__Proxy.cs | 2 +- src/Vlingo.Actors/CompletionSupplier.cs | 2 +- src/Vlingo.Actors/CompletionTranslator.cs | 2 +- src/Vlingo.Actors/DirectoryEvictor.cs | 20 ++-- src/Vlingo.Actors/DirectoryScannerActor.cs | 11 +- src/Vlingo.Actors/DirectoryScanner__Proxy.cs | 2 +- src/Vlingo.Actors/Environment.cs | 2 +- src/Vlingo.Actors/Evictable.cs | 2 +- src/Vlingo.Actors/FailureMark.cs | 2 +- src/Vlingo.Actors/GuidAddressFactory.cs | 6 +- .../ICompletesEventuallyProvider.cs | 2 +- src/Vlingo.Actors/IDirectoryScanner.cs | 2 +- src/Vlingo.Actors/IMailbox.cs | 2 +- src/Vlingo.Actors/IMessage.cs | 2 +- src/Vlingo.Actors/LocalMessage.cs | 2 +- .../Completes/CompletesEventuallyPool.cs | 40 +++---- ...ManyToOneConcurrentArrayQueueDispatcher.cs | 2 +- .../ManyToOneConcurrentArrayQueueMailbox.cs | 2 +- .../ConcurrentQueue/ConcurrentQueueMailbox.cs | 2 +- .../ConcurrentQueue/ExecutorDispatcher.cs | 2 +- .../ConcurrentQueue/ThreadPoolExecutor.cs | 2 +- .../SharedRingBuffer/RingBufferDispatcher.cs | 2 +- .../SharedRingBufferMailbox.cs | 2 +- .../Plugin/Mailbox/TestKit/TestMailbox.cs | 2 +- src/Vlingo.Actors/PooledCompletes.cs | 2 +- src/Vlingo.Actors/Properties.cs | 2 +- src/Vlingo.Actors/ProxyGenerator.cs | 8 +- src/Vlingo.Actors/ResultCompletes.cs | 6 +- src/Vlingo.Actors/ResumingMailbox.cs | 2 +- src/Vlingo.Actors/Routee.cs | 2 +- src/Vlingo.Actors/Router.cs | 2 +- src/Vlingo.Actors/Scheduled__Proxy.cs | 4 +- src/Vlingo.Actors/Stage.cs | 2 +- src/Vlingo.Actors/StowedLocalMessage.cs | 2 +- src/Vlingo.Actors/TestKit/AccessSafely.cs | 110 +++++++++--------- src/Vlingo.Actors/TestKit/TestContext.cs | 14 +-- src/Vlingo.Actors/Vlingo.Actors.csproj | 4 +- src/Vlingo.Actors/World.cs | 4 +- 79 files changed, 353 insertions(+), 372 deletions(-) diff --git a/src/Vlingo.Actors.Tests/ActorLifecycleTest.cs b/src/Vlingo.Actors.Tests/ActorLifecycleTest.cs index 752ef066..b28d0d34 100644 --- a/src/Vlingo.Actors.Tests/ActorLifecycleTest.cs +++ b/src/Vlingo.Actors.Tests/ActorLifecycleTest.cs @@ -6,7 +6,7 @@ // one at https://mozilla.org/MPL/2.0/. using Vlingo.Actors.TestKit; -using Vlingo.Common; +using Vlingo.Xoom.Common; using Xunit; namespace Vlingo.Actors.Tests @@ -37,47 +37,47 @@ public void TestAfterStop() private class TestResults { - private readonly AtomicBoolean receivedBeforeStart = new AtomicBoolean(false); - private readonly AtomicBoolean receivedAfterStop = new AtomicBoolean(false); - internal readonly AccessSafely received; + private readonly AtomicBoolean _receivedBeforeStart = new AtomicBoolean(false); + private readonly AtomicBoolean _receivedAfterStop = new AtomicBoolean(false); + internal readonly AccessSafely Received; private TestResults(AccessSafely received) { - this.received = received; + this.Received = received; } public static TestResults AfterCompleting(int times) { var testResults = new TestResults(AccessSafely.AfterCompleting(times)); - testResults.received.WritingWith("receivedBeforeStart", testResults.receivedBeforeStart.Set); - testResults.received.ReadingWith("receivedBeforeStart", testResults.receivedBeforeStart.Get); - testResults.received.WritingWith("receivedAfterStop", testResults.receivedAfterStop.Set); - testResults.received.ReadingWith("receivedAfterStop", testResults.receivedAfterStop.Get); + testResults.Received.WritingWith("receivedBeforeStart", testResults._receivedBeforeStart.Set); + testResults.Received.ReadingWith("receivedBeforeStart", testResults._receivedBeforeStart.Get); + testResults.Received.WritingWith("receivedAfterStop", testResults._receivedAfterStop.Set); + testResults.Received.ReadingWith("receivedAfterStop", testResults._receivedAfterStop.Get); return testResults; } - public bool GetReceivedBeforeStart() => received.ReadFrom("receivedBeforeStart"); + public bool GetReceivedBeforeStart() => Received.ReadFrom("receivedBeforeStart"); - public bool GetReceivedAfterStop() => received.ReadFrom("receivedAfterStop"); + public bool GetReceivedAfterStop() => Received.ReadFrom("receivedAfterStop"); } private class LifecycleActor : Actor, IStoppable { - private readonly TestResults testResults; + private readonly TestResults _testResults; public LifecycleActor(TestResults testResults) { - this.testResults = testResults; + this._testResults = testResults; } protected internal override void BeforeStart() { - testResults.received.WriteUsing("receivedBeforeStart", true); + _testResults.Received.WriteUsing("receivedBeforeStart", true); } protected internal override void AfterStop() { - testResults.received.WriteUsing("receivedAfterStop", true); + _testResults.Received.WriteUsing("receivedAfterStop", true); } } } diff --git a/src/Vlingo.Actors.Tests/ActorStopTest.cs b/src/Vlingo.Actors.Tests/ActorStopTest.cs index 513a6223..7a3bbdaf 100644 --- a/src/Vlingo.Actors.Tests/ActorStopTest.cs +++ b/src/Vlingo.Actors.Tests/ActorStopTest.cs @@ -5,7 +5,7 @@ // was not distributed with this file, You can obtain // one at https://mozilla.org/MPL/2.0/. -using Vlingo.Common; +using Vlingo.Xoom.Common; using Vlingo.Actors.TestKit; using Xunit; @@ -86,92 +86,92 @@ private IChildCreatingStoppable[] SetUpActors(World world, TestResults results) private class ChildCreatingStoppableActor : Actor, IChildCreatingStoppable { - private readonly TestResults results; + private readonly TestResults _results; public ChildCreatingStoppableActor(TestResults results) { - this.results = results; + this._results = results; } public void CreateChildren() { var pre = Address.Name; - ChildActorFor(Definition.Has(Definition.Parameters(results), $"{pre}.1")); - ChildActorFor(Definition.Has(Definition.Parameters(results), $"{pre}.2")); - ChildActorFor(Definition.Has(Definition.Parameters(results), $"{pre}.3")); + ChildActorFor(Definition.Has(Definition.Parameters(_results), $"{pre}.1")); + ChildActorFor(Definition.Has(Definition.Parameters(_results), $"{pre}.2")); + ChildActorFor(Definition.Has(Definition.Parameters(_results), $"{pre}.3")); } protected internal override void BeforeStart() { base.BeforeStart(); - results.beforeStartCountAccess.WriteUsing("value", 1); + _results.BeforeStartCountAccess.WriteUsing("value", 1); } protected internal override void AfterStop() { - if (results.terminatingAccess.ReadFromNow("value")) + if (_results.TerminatingAccess.ReadFromNow("value")) { - results.terminatingStopCountAccess.WriteUsing("value", 1); + _results.TerminatingStopCountAccess.WriteUsing("value", 1); } else { - results.stopCountAccess.WriteUsing("value", 1); + _results.StopCountAccess.WriteUsing("value", 1); } } } private class TestResults { - internal AccessSafely beforeStartCountAccess = AccessSafely.AfterCompleting(1); - internal AtomicInteger beforeStartCount = new AtomicInteger(0); + internal AccessSafely BeforeStartCountAccess = AccessSafely.AfterCompleting(1); + internal readonly AtomicInteger BeforeStartCount = new AtomicInteger(0); - internal AccessSafely stopCountAccess = AccessSafely.AfterCompleting(1); - internal AtomicInteger stopCount = new AtomicInteger(0); + internal AccessSafely StopCountAccess = AccessSafely.AfterCompleting(1); + internal readonly AtomicInteger StopCount = new AtomicInteger(0); - internal AccessSafely terminatingAccess = AccessSafely.AfterCompleting(1); - internal AtomicBoolean terminating = new AtomicBoolean(false); + internal AccessSafely TerminatingAccess = AccessSafely.AfterCompleting(1); + internal readonly AtomicBoolean Terminating = new AtomicBoolean(false); - internal AccessSafely terminatingStopCountAccess = AccessSafely.AfterCompleting(1); - internal AtomicInteger terminatingStopCount = new AtomicInteger(0); + internal AccessSafely TerminatingStopCountAccess = AccessSafely.AfterCompleting(1); + internal readonly AtomicInteger TerminatingStopCount = new AtomicInteger(0); public AccessSafely BeforeStartCountAccessCompletes(int times) { - beforeStartCountAccess = AccessSafely + BeforeStartCountAccess = AccessSafely .AfterCompleting(times) - .WritingWith("value", (int value) => beforeStartCount.Set(beforeStartCount.Get() + value)) - .ReadingWith("value", () => beforeStartCount.Get()); + .WritingWith("value", (int value) => BeforeStartCount.Set(BeforeStartCount.Get() + value)) + .ReadingWith("value", () => BeforeStartCount.Get()); - return beforeStartCountAccess; + return BeforeStartCountAccess; } public AccessSafely StopCountAccessCompletes(int times) { - stopCountAccess = AccessSafely + StopCountAccess = AccessSafely .AfterCompleting(times) - .WritingWith("value", (int value) => stopCount.Set(stopCount.Get() + value)) - .ReadingWith("value", () => stopCount.Get()); + .WritingWith("value", (int value) => StopCount.Set(StopCount.Get() + value)) + .ReadingWith("value", () => StopCount.Get()); - return stopCountAccess; + return StopCountAccess; } public AccessSafely TerminatingAccessCompletes(int times) { - terminatingAccess = AccessSafely + TerminatingAccess = AccessSafely .AfterCompleting(times) - .WritingWith("value", (bool flag) => terminating.Set(flag)) - .ReadingWith("value", () => terminating.Get()); + .WritingWith("value", (bool flag) => Terminating.Set(flag)) + .ReadingWith("value", () => Terminating.Get()); - return terminatingAccess; + return TerminatingAccess; } public AccessSafely TerminatingStopCountAccessCompletes(int times) { - terminatingStopCountAccess = AccessSafely + TerminatingStopCountAccess = AccessSafely .AfterCompleting(times) - .WritingWith("value", (int value) => terminatingStopCount.Set(terminatingStopCount.Get() + value)) - .ReadingWith("value", () => terminatingStopCount.Get()); + .WritingWith("value", (int value) => TerminatingStopCount.Set(TerminatingStopCount.Get() + value)) + .ReadingWith("value", () => TerminatingStopCount.Get()); - return terminatingStopCountAccess; + return TerminatingStopCountAccess; } } } diff --git a/src/Vlingo.Actors.Tests/ActorStowDisperseTest.cs b/src/Vlingo.Actors.Tests/ActorStowDisperseTest.cs index baa3352d..7464c10c 100644 --- a/src/Vlingo.Actors.Tests/ActorStowDisperseTest.cs +++ b/src/Vlingo.Actors.Tests/ActorStowDisperseTest.cs @@ -7,7 +7,7 @@ using System; using Vlingo.Actors.TestKit; -using Vlingo.Common; +using Vlingo.Xoom.Common; using Xunit; namespace Vlingo.Actors.Tests @@ -30,8 +30,8 @@ public void TestThatStowedMessagesDisperseOnOverride() protocols._2.Override(); - Assert.Equal(1, results.overrideAccess.ReadFrom("overrideReceivedCount")); - Assert.Equal(10, results.stowedAccess.ReadFrom("stowReceivedCount")); + Assert.Equal(1, results.OverrideAccess.ReadFrom("overrideReceivedCount")); + Assert.Equal(10, results.StowedAccess.ReadFrom("stowReceivedCount")); } [Fact] @@ -50,59 +50,59 @@ public void TestThatStowedMessagesDisperseOnCrash() protocols._2.Crash(); - Assert.Equal(1, results.overrideAccess.ReadFrom("overrideReceivedCount")); - Assert.Equal(10, results.stowedAccess.ReadFrom("stowReceivedCount")); + Assert.Equal(1, results.OverrideAccess.ReadFrom("overrideReceivedCount")); + Assert.Equal(10, results.StowedAccess.ReadFrom("stowReceivedCount")); } private class Results { - public readonly AccessSafely overrideAccess; - public readonly AccessSafely stowedAccess; - public readonly AtomicInteger overrideReceivedCount; - public readonly AtomicInteger stowReceivedCount; + public readonly AccessSafely OverrideAccess; + public readonly AccessSafely StowedAccess; + public readonly AtomicInteger OverrideReceivedCount; + public readonly AtomicInteger StowReceivedCount; public Results(int overrideReceived, int stowReceived) { - overrideReceivedCount = new AtomicInteger(0); - stowReceivedCount = new AtomicInteger(0); + OverrideReceivedCount = new AtomicInteger(0); + StowReceivedCount = new AtomicInteger(0); - stowedAccess = AccessSafely + StowedAccess = AccessSafely .AfterCompleting(stowReceived) - .WritingWith("stowReceivedCount", (int increment) => stowReceivedCount.Set(stowReceivedCount.Get() + increment)) - .ReadingWith("stowReceivedCount", () => stowReceivedCount.Get()); + .WritingWith("stowReceivedCount", (int increment) => StowReceivedCount.Set(StowReceivedCount.Get() + increment)) + .ReadingWith("stowReceivedCount", () => StowReceivedCount.Get()); - overrideAccess = AccessSafely + OverrideAccess = AccessSafely .AfterCompleting(overrideReceived) - .WritingWith("overrideReceivedCount", (int increment) => overrideReceivedCount.Set(overrideReceivedCount.Get() + increment)) - .ReadingWith("overrideReceivedCount", () => overrideReceivedCount.Get()); + .WritingWith("overrideReceivedCount", (int increment) => OverrideReceivedCount.Set(OverrideReceivedCount.Get() + increment)) + .ReadingWith("overrideReceivedCount", () => OverrideReceivedCount.Get()); } } private class StowTestActor : Actor, IOverrideStowage, IStowThese { - private readonly Results results; + private readonly Results _results; public StowTestActor(Results results) { - this.results = results; + _results = results; StowMessages(typeof(IOverrideStowage)); } public void Crash() { - results.overrideAccess.WriteUsing("overrideReceivedCount", 1); + _results.OverrideAccess.WriteUsing("overrideReceivedCount", 1); throw new ApplicationException("Intended failure"); } public void Override() { - results.overrideAccess.WriteUsing("overrideReceivedCount", 1); + _results.OverrideAccess.WriteUsing("overrideReceivedCount", 1); DisperseStowedMessages(); } public void Stow() { - results.stowedAccess.WriteUsing("stowReceivedCount", 1); + _results.StowedAccess.WriteUsing("stowReceivedCount", 1); } protected internal override void BeforeResume(Exception reason) diff --git a/src/Vlingo.Actors.Tests/AnswerEventuallyTest.cs b/src/Vlingo.Actors.Tests/AnswerEventuallyTest.cs index 80e30dc4..15c409c7 100644 --- a/src/Vlingo.Actors.Tests/AnswerEventuallyTest.cs +++ b/src/Vlingo.Actors.Tests/AnswerEventuallyTest.cs @@ -7,15 +7,15 @@ using System; using Vlingo.Actors.TestKit; -using Vlingo.Common; +using Vlingo.Xoom.Common; using Xunit; namespace Vlingo.Actors.Tests { public class AnswerEventuallyTest : IDisposable { - private AtomicInteger _value = new AtomicInteger(0); - private IAnswerGiver _answerGiver; + private readonly AtomicInteger _value = new AtomicInteger(0); + private readonly IAnswerGiver _answerGiver; private readonly World _world; [Fact] diff --git a/src/Vlingo.Actors.Tests/BroadcastRouterTest.cs b/src/Vlingo.Actors.Tests/BroadcastRouterTest.cs index fc9e7c4d..b70b6869 100644 --- a/src/Vlingo.Actors.Tests/BroadcastRouterTest.cs +++ b/src/Vlingo.Actors.Tests/BroadcastRouterTest.cs @@ -6,7 +6,7 @@ // one at https://mozilla.org/MPL/2.0/. using Vlingo.Actors.TestKit; -using Vlingo.Common; +using Vlingo.Xoom.Common; using Xunit; namespace Vlingo.Actors.Tests diff --git a/src/Vlingo.Actors.Tests/CharactersTest.cs b/src/Vlingo.Actors.Tests/CharactersTest.cs index 4da2c63a..c47ad33d 100644 --- a/src/Vlingo.Actors.Tests/CharactersTest.cs +++ b/src/Vlingo.Actors.Tests/CharactersTest.cs @@ -7,7 +7,7 @@ using System.Collections.Generic; using Vlingo.Actors.TestKit; -using Vlingo.Common; +using Vlingo.Xoom.Common; using Xunit; namespace Vlingo.Actors.Tests diff --git a/src/Vlingo.Actors.Tests/CompletesActorProtocolTest.cs b/src/Vlingo.Actors.Tests/CompletesActorProtocolTest.cs index c1afee50..5cae05c7 100644 --- a/src/Vlingo.Actors.Tests/CompletesActorProtocolTest.cs +++ b/src/Vlingo.Actors.Tests/CompletesActorProtocolTest.cs @@ -7,7 +7,7 @@ using System; using System.Threading; -using Vlingo.Common; +using Vlingo.Xoom.Common; using Vlingo.Actors.TestKit; using Xunit; diff --git a/src/Vlingo.Actors.Tests/GuidAddressTest.cs b/src/Vlingo.Actors.Tests/GuidAddressTest.cs index 75cd7c70..4c6f5320 100644 --- a/src/Vlingo.Actors.Tests/GuidAddressTest.cs +++ b/src/Vlingo.Actors.Tests/GuidAddressTest.cs @@ -7,8 +7,8 @@ using System; using Vlingo.Actors.TestKit; -using Vlingo.Common; -using Vlingo.Common.Identity; +using Vlingo.Xoom.Common; +using Vlingo.Xoom.Common.Identity; using Xunit; namespace Vlingo.Actors.Tests diff --git a/src/Vlingo.Actors.Tests/LocalMessageTest.cs b/src/Vlingo.Actors.Tests/LocalMessageTest.cs index 271af561..0142ed3a 100644 --- a/src/Vlingo.Actors.Tests/LocalMessageTest.cs +++ b/src/Vlingo.Actors.Tests/LocalMessageTest.cs @@ -8,7 +8,7 @@ using System; using System.Threading; using Vlingo.Actors.TestKit; -using Vlingo.Common; +using Vlingo.Xoom.Common; using Xunit; namespace Vlingo.Actors.Tests diff --git a/src/Vlingo.Actors.Tests/MockCompletes.cs b/src/Vlingo.Actors.Tests/MockCompletes.cs index df286d5c..ddc7b28f 100644 --- a/src/Vlingo.Actors.Tests/MockCompletes.cs +++ b/src/Vlingo.Actors.Tests/MockCompletes.cs @@ -5,37 +5,37 @@ // was not distributed with this file, You can obtain // one at https://mozilla.org/MPL/2.0/. -using Vlingo.Common; +using Vlingo.Xoom.Common; using Vlingo.Actors.TestKit; namespace Vlingo.Actors.Tests { public class MockCompletes : BasicCompletes where T:class { - private readonly AtomicReference outcome = new AtomicReference(default(T)); - private readonly AtomicInteger withCount = new AtomicInteger(0); - private readonly AccessSafely safely; + private readonly AtomicReference _outcome = new AtomicReference(default(T)); + private readonly AtomicInteger _withCount = new AtomicInteger(0); + private readonly AccessSafely _safely; public MockCompletes(int times) : base((Scheduler)null) { - safely = AccessSafely.AfterCompleting(times) + _safely = AccessSafely.AfterCompleting(times) .WritingWith("outcome", val => { - outcome.Set(val); - withCount.IncrementAndGet(); + _outcome.Set(val); + _withCount.IncrementAndGet(); }) - .ReadingWith("outcome", outcome.Get) - .ReadingWith("count", withCount.Get); + .ReadingWith("outcome", _outcome.Get) + .ReadingWith("count", _withCount.Get); } - public int WithCount => safely.ReadFrom("count"); + public int WithCount => _safely.ReadFrom("count"); - public override T Outcome => safely.ReadFrom("outcome"); + public override T Outcome => _safely.ReadFrom("outcome"); public override ICompletes With(TOutcome outcome) { - safely.WriteUsing("outcome", (T)(object)outcome); + _safely.WriteUsing("outcome", (T)(object)outcome); return (ICompletes)this; } } diff --git a/src/Vlingo.Actors.Tests/Plugin/Completes/MockCompletesEventually.cs b/src/Vlingo.Actors.Tests/Plugin/Completes/MockCompletesEventually.cs index 756034c9..6c994edf 100644 --- a/src/Vlingo.Actors.Tests/Plugin/Completes/MockCompletesEventually.cs +++ b/src/Vlingo.Actors.Tests/Plugin/Completes/MockCompletesEventually.cs @@ -5,7 +5,7 @@ // was not distributed with this file, You can obtain // one at https://mozilla.org/MPL/2.0/. -using Vlingo.Common; +using Vlingo.Xoom.Common; namespace Vlingo.Actors.Tests.Plugin.Completes { diff --git a/src/Vlingo.Actors.Tests/Plugin/Completes/MockCompletesEventuallyProvider.cs b/src/Vlingo.Actors.Tests/Plugin/Completes/MockCompletesEventuallyProvider.cs index 72318734..cf940e18 100644 --- a/src/Vlingo.Actors.Tests/Plugin/Completes/MockCompletesEventuallyProvider.cs +++ b/src/Vlingo.Actors.Tests/Plugin/Completes/MockCompletesEventuallyProvider.cs @@ -5,7 +5,7 @@ // was not distributed with this file, You can obtain // one at https://mozilla.org/MPL/2.0/. -using Vlingo.Common; +using Vlingo.Xoom.Common; namespace Vlingo.Actors.Tests.Plugin.Completes { diff --git a/src/Vlingo.Actors.Tests/Plugin/Completes/MockRegistrar.cs b/src/Vlingo.Actors.Tests/Plugin/Completes/MockRegistrar.cs index 22031177..e6f9e2e4 100644 --- a/src/Vlingo.Actors.Tests/Plugin/Completes/MockRegistrar.cs +++ b/src/Vlingo.Actors.Tests/Plugin/Completes/MockRegistrar.cs @@ -6,20 +6,19 @@ // one at https://mozilla.org/MPL/2.0/. using System; -using Vlingo.Common; namespace Vlingo.Actors.Tests.Plugin.Completes { public class MockRegistrar : IRegistrar { - public int registerCount; + public int RegisterCount; public World World => null; public void Register(string name, ICompletesEventuallyProvider completesEventuallyProvider) { completesEventuallyProvider.InitializeUsing(null); - ++registerCount; + ++RegisterCount; } public void Register(string name, bool isDefault, ILoggerProvider loggerProvider) diff --git a/src/Vlingo.Actors.Tests/Plugin/Completes/PooledCompletesPluginTest.cs b/src/Vlingo.Actors.Tests/Plugin/Completes/PooledCompletesPluginTest.cs index 6de09e45..5e74e793 100644 --- a/src/Vlingo.Actors.Tests/Plugin/Completes/PooledCompletesPluginTest.cs +++ b/src/Vlingo.Actors.Tests/Plugin/Completes/PooledCompletesPluginTest.cs @@ -23,7 +23,7 @@ public void TestStart() completes.With(7); - Assert.Equal(1, registrar.registerCount); + Assert.Equal(1, registrar.RegisterCount); Assert.Equal(1, plugin.completesEventuallyProvider.initializeUsing); Assert.Equal(1, plugin.completesEventuallyProvider.provideCompletesForCount); Assert.Equal(2, completesResults.WithCount.Get()); diff --git a/src/Vlingo.Actors.Tests/Plugin/Mailbox/AgronaMPSCArrayQueue/ManyToOneConcurrentArrayQueueDispatcherTest.cs b/src/Vlingo.Actors.Tests/Plugin/Mailbox/AgronaMPSCArrayQueue/ManyToOneConcurrentArrayQueueDispatcherTest.cs index 3edd95c5..2fb01798 100644 --- a/src/Vlingo.Actors.Tests/Plugin/Mailbox/AgronaMPSCArrayQueue/ManyToOneConcurrentArrayQueueDispatcherTest.cs +++ b/src/Vlingo.Actors.Tests/Plugin/Mailbox/AgronaMPSCArrayQueue/ManyToOneConcurrentArrayQueueDispatcherTest.cs @@ -8,7 +8,7 @@ using System; using System.Threading; using Vlingo.Actors.Plugin.Mailbox.AgronaMPSCArrayQueue; -using Vlingo.Common; +using Vlingo.Xoom.Common; using Vlingo.Actors.TestKit; using Xunit; diff --git a/src/Vlingo.Actors.Tests/Plugin/Mailbox/AgronaMPSCArrayQueue/ManyToOneConcurrentArrayQueueMailboxActorTest.cs b/src/Vlingo.Actors.Tests/Plugin/Mailbox/AgronaMPSCArrayQueue/ManyToOneConcurrentArrayQueueMailboxActorTest.cs index d242973f..6a030da1 100644 --- a/src/Vlingo.Actors.Tests/Plugin/Mailbox/AgronaMPSCArrayQueue/ManyToOneConcurrentArrayQueueMailboxActorTest.cs +++ b/src/Vlingo.Actors.Tests/Plugin/Mailbox/AgronaMPSCArrayQueue/ManyToOneConcurrentArrayQueueMailboxActorTest.cs @@ -8,7 +8,7 @@ using Vlingo.Actors.Plugin; using Vlingo.Actors.Plugin.Completes; using Vlingo.Actors.Plugin.Mailbox.AgronaMPSCArrayQueue; -using Vlingo.Common; +using Vlingo.Xoom.Common; using Vlingo.Actors.TestKit; using Xunit; diff --git a/src/Vlingo.Actors.Tests/Plugin/Mailbox/ConcurrentQueue/ExecutorDispatcherTest.cs b/src/Vlingo.Actors.Tests/Plugin/Mailbox/ConcurrentQueue/ExecutorDispatcherTest.cs index 56e8d827..c91eeea8 100644 --- a/src/Vlingo.Actors.Tests/Plugin/Mailbox/ConcurrentQueue/ExecutorDispatcherTest.cs +++ b/src/Vlingo.Actors.Tests/Plugin/Mailbox/ConcurrentQueue/ExecutorDispatcherTest.cs @@ -10,7 +10,7 @@ using System.Collections.Generic; using System.Threading.Tasks; using Vlingo.Actors.Plugin.Mailbox.ConcurrentQueue; -using Vlingo.Common; +using Vlingo.Xoom.Common; using Vlingo.Actors.TestKit; using Xunit; @@ -20,17 +20,17 @@ public class ExecutorDispatcherTest : ActorsTest { private const int Total = 10_000; - private readonly IDispatcher dispatcher; + private readonly IDispatcher _dispatcher; public ExecutorDispatcherTest() { - dispatcher = new ExecutorDispatcher(1, 1f); + _dispatcher = new ExecutorDispatcher(1, 1f); } public override void Dispose() { base.Dispose(); - dispatcher.Close(); + _dispatcher.Close(); } [Fact] @@ -46,15 +46,15 @@ public void TestClose() Action consumer = consumerActor => consumerActor.Take(countParam); var message = new LocalMessage(actor, consumer, "Take(int)"); mailbox.Send(message); - dispatcher.Execute(mailbox); + _dispatcher.Execute(mailbox); } - dispatcher.Close(); + _dispatcher.Close(); Action consumer2 = consumerActor => consumerActor.Take(10); var message2 = new LocalMessage(actor, consumer2, "Take(int)"); mailbox.Send(message2); - dispatcher.Execute(mailbox); + _dispatcher.Execute(mailbox); var counts = testResults.GetCounts(); Assert.Equal(3, counts.Count); @@ -77,7 +77,7 @@ public void TestExecute() Action consumer = consumerActor => consumerActor.Take(countParam); var message = new LocalMessage(actor, consumer, "Take(int)"); mailbox.Send(message); - dispatcher.Execute(mailbox); + _dispatcher.Execute(mailbox); } List counts = testResults.GetCounts(); @@ -91,21 +91,20 @@ public void TestExecute() [Fact] public void TestRequiresExecutionNotification() { - Assert.False(dispatcher.RequiresExecutionNotification); + Assert.False(_dispatcher.RequiresExecutionNotification); } - private class TestMailbox : IMailbox { - private readonly TestResults testResults; - private readonly ILogger logger; - private readonly ConcurrentQueue queue; + private readonly TestResults _testResults; + private readonly ILogger _logger; + private readonly ConcurrentQueue _queue; public TestMailbox(TestResults testResults, ILogger logger) { - this.testResults = testResults; - this.logger = logger; - queue = new ConcurrentQueue(); + _testResults = testResults; + _logger = logger; + _queue = new ConcurrentQueue(); } public TaskScheduler TaskScheduler { get; } @@ -128,7 +127,7 @@ public void Close() { } public IMessage Receive() { - if (queue.TryDequeue(out var message)) + if (_queue.TryDequeue(out var message)) { return message; } @@ -139,22 +138,22 @@ public IMessage Receive() public void Run() { var message = Receive(); - if (testResults.shouldLog) + if (_testResults.ShouldLog) { - logger.Debug($"TestMailBox: Run: received: {message}"); + _logger.Debug($"TestMailBox: Run: received: {message}"); } if (message != null) { message.Deliver(); - if (testResults.shouldLog) + if (_testResults.ShouldLog) { - logger.Debug($"TestMailBox: Run: adding: {testResults.GetHighest()}"); + _logger.Debug($"TestMailBox: Run: adding: {_testResults.GetHighest()}"); } } } - public void Send(IMessage message) => queue.Enqueue(message); + public void Send(IMessage message) => _queue.Enqueue(message); public void Send(Actor actor, Action consumer, ICompletes completes, string representation) => throw new NotSupportedException("ExecutorDispatcherTest does not support this operation"); @@ -165,31 +164,31 @@ public void SuspendExceptFor(string name, params Type[] overrides) private class CountTakerActor : Actor, ICountTaker { - private readonly TestResults testResults; - private readonly ILogger logger; + private readonly TestResults _testResults; + private readonly ILogger _logger; public CountTakerActor(TestResults testResults, ILogger logger) { - this.testResults = testResults; - this.logger = logger; + _testResults = testResults; + _logger = logger; } - public void Take(int count) => testResults.Take(count, logger); + public void Take(int count) => _testResults.Take(count, _logger); } private class TestResults { - private readonly AccessSafely safely; - internal readonly bool shouldLog; + private readonly AccessSafely _safely; + internal readonly bool ShouldLog; public TestResults(int happenings, bool shouldLog) { - this.shouldLog = shouldLog; + ShouldLog = shouldLog; var counts = new List(); var highest = new AtomicInteger(0); - safely = AccessSafely + _safely = AccessSafely .AfterCompleting(happenings) .WritingWith("results", (count, logger) => { @@ -213,11 +212,11 @@ public TestResults(int happenings, bool shouldLog) .ReadingWith("highest", highest.Get); } - public void Take(int count, ILogger logger) => safely.WriteUsing("results", count, logger); + public void Take(int count, ILogger logger) => _safely.WriteUsing("results", count, logger); - public List GetCounts() => safely.ReadFrom>("results"); + public List GetCounts() => _safely.ReadFrom>("results"); - public int GetHighest() => safely.ReadFrom("highest"); + public int GetHighest() => _safely.ReadFrom("highest"); } } } diff --git a/src/Vlingo.Actors.Tests/Plugin/Mailbox/SharedRingBuffer/PropertiesFileConfigRingBufferMailboxActorTest.cs b/src/Vlingo.Actors.Tests/Plugin/Mailbox/SharedRingBuffer/PropertiesFileConfigRingBufferMailboxActorTest.cs index 488408f7..5e994509 100644 --- a/src/Vlingo.Actors.Tests/Plugin/Mailbox/SharedRingBuffer/PropertiesFileConfigRingBufferMailboxActorTest.cs +++ b/src/Vlingo.Actors.Tests/Plugin/Mailbox/SharedRingBuffer/PropertiesFileConfigRingBufferMailboxActorTest.cs @@ -6,7 +6,7 @@ // one at https://mozilla.org/MPL/2.0/. using Vlingo.Actors.TestKit; -using Vlingo.Common; +using Vlingo.Xoom.Common; using Xunit; namespace Vlingo.Actors.Tests.Plugin.Mailbox.SharedRingBuffer @@ -27,24 +27,21 @@ public void TestThatRingBufferIsUsed() public class OneBehaviorActor : Actor, IOneBehavior { - private readonly TestResults results; + private readonly TestResults _results; - public OneBehaviorActor(TestResults results) - { - this.results = results; - } + public OneBehaviorActor(TestResults results) => _results = results; - public void DoSomething() => results.Invoked(); + public void DoSomething() => _results.Invoked(); } public class TestResults { - private readonly AccessSafely safely; + private readonly AccessSafely _safely; public TestResults(int happenings) { var times = new AtomicInteger(0); - safely = AccessSafely + _safely = AccessSafely .AfterCompleting(happenings) .WritingWith("times", _ => times.IncrementAndGet()) .ReadingWith("times", times.Get); @@ -52,10 +49,10 @@ public TestResults(int happenings) public int Times { - get => safely.ReadFrom("times"); + get => _safely.ReadFrom("times"); } - public void Invoked() => safely.WriteUsing("times", 1); + public void Invoked() => _safely.WriteUsing("times", 1); } } diff --git a/src/Vlingo.Actors.Tests/Plugin/Mailbox/SharedRingBuffer/RingBufferDispatcherTest.cs b/src/Vlingo.Actors.Tests/Plugin/Mailbox/SharedRingBuffer/RingBufferDispatcherTest.cs index 4f91ec18..90aaf55e 100644 --- a/src/Vlingo.Actors.Tests/Plugin/Mailbox/SharedRingBuffer/RingBufferDispatcherTest.cs +++ b/src/Vlingo.Actors.Tests/Plugin/Mailbox/SharedRingBuffer/RingBufferDispatcherTest.cs @@ -8,7 +8,7 @@ using System; using System.Threading; using Vlingo.Actors.Plugin.Mailbox.SharedRingBuffer; -using Vlingo.Common; +using Vlingo.Xoom.Common; using Vlingo.Actors.TestKit; using Xunit; diff --git a/src/Vlingo.Actors.Tests/Plugin/Mailbox/SharedRingBuffer/RingBufferMailboxActorTest.cs b/src/Vlingo.Actors.Tests/Plugin/Mailbox/SharedRingBuffer/RingBufferMailboxActorTest.cs index 1d30c006..58c9a3ae 100644 --- a/src/Vlingo.Actors.Tests/Plugin/Mailbox/SharedRingBuffer/RingBufferMailboxActorTest.cs +++ b/src/Vlingo.Actors.Tests/Plugin/Mailbox/SharedRingBuffer/RingBufferMailboxActorTest.cs @@ -11,7 +11,7 @@ using Vlingo.Actors.Plugin.Completes; using Vlingo.Actors.Plugin.Mailbox.SharedRingBuffer; using Vlingo.Actors.TestKit; -using Vlingo.Common; +using Vlingo.Xoom.Common; using Xunit; using Xunit.Abstractions; diff --git a/src/Vlingo.Actors.Tests/RandomRouterTest.cs b/src/Vlingo.Actors.Tests/RandomRouterTest.cs index 1077c12d..4127d3a5 100644 --- a/src/Vlingo.Actors.Tests/RandomRouterTest.cs +++ b/src/Vlingo.Actors.Tests/RandomRouterTest.cs @@ -7,7 +7,7 @@ using System.Collections.Generic; using Vlingo.Actors.TestKit; -using Vlingo.Common; +using Vlingo.Xoom.Common; using Xunit; namespace Vlingo.Actors.Tests @@ -117,27 +117,24 @@ public void Remember(int number) private class TestConsumerWorker : Actor, IOneArgConsumerProtocol { - private readonly Results results; + private readonly Results _results; - public TestConsumerWorker(Results results) - { - this.results = results; - } + public TestConsumerWorker(Results results) => _results = results; - public void Remember(int number) => results.Access.WriteUsing("answers", number); + public void Remember(int number) => _results.Access.WriteUsing("answers", number); } private class Results { - private readonly int[] answers; - private int index; + private readonly int[] _answers; + private int _index; public AccessSafely Access { get; private set; } public Results(int totalAnswers) { - answers = new int[totalAnswers]; - index = 0; + _answers = new int[totalAnswers]; + _index = 0; Access = AfterCompleting(totalAnswers); } @@ -145,8 +142,8 @@ private AccessSafely AfterCompleting(int steps) { Access = AccessSafely .AfterCompleting(steps) - .WritingWith("answers", answer => answers[index++] = answer) - .ReadingWith("answers", indx => answers[indx]); + .WritingWith("answers", answer => _answers[_index++] = answer) + .ReadingWith("answers", indx => _answers[indx]); return Access; } diff --git a/src/Vlingo.Actors.Tests/RoundRobinRouterTest.cs b/src/Vlingo.Actors.Tests/RoundRobinRouterTest.cs index 8c51fe03..eb3c9ffe 100644 --- a/src/Vlingo.Actors.Tests/RoundRobinRouterTest.cs +++ b/src/Vlingo.Actors.Tests/RoundRobinRouterTest.cs @@ -7,7 +7,7 @@ using System.Collections.Generic; using Vlingo.Actors.TestKit; -using Vlingo.Common; +using Vlingo.Xoom.Common; using Xunit; namespace Vlingo.Actors.Tests @@ -72,15 +72,15 @@ public ICompletes ProductOf(int arg1, int arg2) private class Results { - private readonly int[] answers; - private int index; + private readonly int[] _answers; + private int _index; public AccessSafely Access { get; private set; } public Results(int totalAnswers) { - answers = new int[totalAnswers]; - index = 0; + _answers = new int[totalAnswers]; + _index = 0; Access = AfterCompleting(totalAnswers); } @@ -88,8 +88,8 @@ private AccessSafely AfterCompleting(int steps) { Access = AccessSafely .AfterCompleting(steps) - .WritingWith("answers", (int answer) => answers[index++] = answer) - .ReadingWith("answers", (int index) => answers[index]); + .WritingWith("answers", (int answer) => _answers[_index++] = answer) + .ReadingWith("answers", (int index) => _answers[index]); return Access; } diff --git a/src/Vlingo.Actors.Tests/SchedulerTest.cs b/src/Vlingo.Actors.Tests/SchedulerTest.cs index e1e1c02f..5f844dd0 100644 --- a/src/Vlingo.Actors.Tests/SchedulerTest.cs +++ b/src/Vlingo.Actors.Tests/SchedulerTest.cs @@ -6,7 +6,7 @@ // one at https://mozilla.org/MPL/2.0/. using System; -using Vlingo.Common; +using Vlingo.Xoom.Common; using Vlingo.Actors.TestKit; using Xunit; @@ -14,18 +14,18 @@ namespace Vlingo.Actors.Tests { public class SchedulerTest : ActorsTest { - private readonly IScheduled scheduled; - private readonly Scheduler scheduler; + private readonly IScheduled _scheduled; + private readonly Scheduler _scheduler; public SchedulerTest() { - scheduled = new Scheduled(); - scheduler = new Scheduler(); + _scheduled = new Scheduled(); + _scheduler = new Scheduler(); } public override void Dispose() { - scheduler.Close(); + _scheduler.Close(); base.Dispose(); } @@ -34,7 +34,7 @@ public void TestScheduleOnceOneHappyDelivery() { var holder = new CounterHolder(1); - scheduler.ScheduleOnce(scheduled, holder, TimeSpan.Zero, TimeSpan.FromMilliseconds(1)); + _scheduler.ScheduleOnce(_scheduled, holder, TimeSpan.Zero, TimeSpan.FromMilliseconds(1)); Assert.Equal(1, holder.GetCounter()); } @@ -44,7 +44,7 @@ public void TestScheduleManyHappyDelivery() { var holder = new CounterHolder(505); - scheduler.Schedule(scheduled, holder, TimeSpan.Zero, TimeSpan.FromMilliseconds(1)); + _scheduler.Schedule(_scheduled, holder, TimeSpan.Zero, TimeSpan.FromMilliseconds(1)); Assert.True(holder.GetCounter() > 500); } diff --git a/src/Vlingo.Actors.Tests/StageTest.cs b/src/Vlingo.Actors.Tests/StageTest.cs index 44611e95..a0610dcd 100644 --- a/src/Vlingo.Actors.Tests/StageTest.cs +++ b/src/Vlingo.Actors.Tests/StageTest.cs @@ -11,7 +11,7 @@ using System.Threading; using System.Threading.Tasks; using Vlingo.Actors.Plugin.Mailbox.TestKit; -using Vlingo.Common; +using Vlingo.Xoom.Common; using Xunit; using TestResults = Vlingo.Actors.Tests.WorldTest.TestResults; using SimpleActor = Vlingo.Actors.Tests.WorldTest.SimpleActor; diff --git a/src/Vlingo.Actors.Tests/Supervision/BasicSupervisionTest.cs b/src/Vlingo.Actors.Tests/Supervision/BasicSupervisionTest.cs index 52d3f25f..f689383d 100644 --- a/src/Vlingo.Actors.Tests/Supervision/BasicSupervisionTest.cs +++ b/src/Vlingo.Actors.Tests/Supervision/BasicSupervisionTest.cs @@ -7,7 +7,7 @@ using System; using Vlingo.Actors.TestKit; -using Vlingo.Common; +using Vlingo.Xoom.Common; using Xunit; namespace Vlingo.Actors.Tests.Supervision diff --git a/src/Vlingo.Actors.Tests/Supervision/EscalateSupervisorActor.cs b/src/Vlingo.Actors.Tests/Supervision/EscalateSupervisorActor.cs index d61f4062..4b610e01 100644 --- a/src/Vlingo.Actors.Tests/Supervision/EscalateSupervisorActor.cs +++ b/src/Vlingo.Actors.Tests/Supervision/EscalateSupervisorActor.cs @@ -7,18 +7,15 @@ using System; using Vlingo.Actors.TestKit; -using Vlingo.Common; +using Vlingo.Xoom.Common; namespace Vlingo.Actors.Tests.Supervision { public class EscalateSupervisorActor : Actor, ISupervisor { - private readonly EscalateSupervisorTestResults testResults; + private readonly EscalateSupervisorTestResults _testResults; - public EscalateSupervisorActor(EscalateSupervisorTestResults testResults) - { - this.testResults = testResults; - } + public EscalateSupervisorActor(EscalateSupervisorTestResults testResults) => _testResults = testResults; public ISupervisionStrategy SupervisionStrategy { get; } = new SupervisionStrategyImpl(); @@ -27,7 +24,7 @@ public EscalateSupervisorActor(EscalateSupervisorTestResults testResults) public void Inform(Exception error, ISupervised supervised) { supervised.Escalate(); - testResults.Access.WriteUsing("informedCount", 1); + _testResults.Access.WriteUsing("informedCount", 1); } private class SupervisionStrategyImpl : ISupervisionStrategy diff --git a/src/Vlingo.Actors.Tests/Supervision/FailureControlActor.cs b/src/Vlingo.Actors.Tests/Supervision/FailureControlActor.cs index f7c496f5..32de662b 100644 --- a/src/Vlingo.Actors.Tests/Supervision/FailureControlActor.cs +++ b/src/Vlingo.Actors.Tests/Supervision/FailureControlActor.cs @@ -7,7 +7,7 @@ using System; using System.Threading; -using Vlingo.Common; +using Vlingo.Xoom.Common; using Vlingo.Actors.TestKit; namespace Vlingo.Actors.Tests.Supervision diff --git a/src/Vlingo.Actors.Tests/Supervision/PingActor.cs b/src/Vlingo.Actors.Tests/Supervision/PingActor.cs index f3ce7c05..b76d8ff9 100644 --- a/src/Vlingo.Actors.Tests/Supervision/PingActor.cs +++ b/src/Vlingo.Actors.Tests/Supervision/PingActor.cs @@ -7,7 +7,7 @@ using System; using System.Threading; -using Vlingo.Common; +using Vlingo.Xoom.Common; using Vlingo.Actors.TestKit; namespace Vlingo.Actors.Tests.Supervision @@ -16,24 +16,24 @@ public class PingActor : Actor, IPing { public static ThreadLocal Instance = new ThreadLocal(); - private readonly PingTestResults testResults; + private readonly PingTestResults _testResults; public PingActor(PingTestResults testResults) { - this.testResults = testResults; + _testResults = testResults; Instance.Value = this; } public void Ping() { - testResults.Access.WriteUsing("pingCount", 1); + _testResults.Access.WriteUsing("pingCount", 1); throw new ApplicationException("Intended Ping failure."); } public override void Stop() { base.Stop(); - testResults.Access.WriteUsing("stopCount", 1); + _testResults.Access.WriteUsing("stopCount", 1); } public class PingTestResults diff --git a/src/Vlingo.Actors.Tests/Supervision/PingSupervisorActor.cs b/src/Vlingo.Actors.Tests/Supervision/PingSupervisorActor.cs index 36b52764..ba1168a0 100644 --- a/src/Vlingo.Actors.Tests/Supervision/PingSupervisorActor.cs +++ b/src/Vlingo.Actors.Tests/Supervision/PingSupervisorActor.cs @@ -7,7 +7,7 @@ using System; using System.Threading; -using Vlingo.Common; +using Vlingo.Xoom.Common; using Vlingo.Actors.TestKit; namespace Vlingo.Actors.Tests.Supervision diff --git a/src/Vlingo.Actors.Tests/Supervision/PongActor.cs b/src/Vlingo.Actors.Tests/Supervision/PongActor.cs index f93c298c..46a32b24 100644 --- a/src/Vlingo.Actors.Tests/Supervision/PongActor.cs +++ b/src/Vlingo.Actors.Tests/Supervision/PongActor.cs @@ -7,7 +7,7 @@ using System; using System.Threading; -using Vlingo.Common; +using Vlingo.Xoom.Common; using Vlingo.Actors.TestKit; namespace Vlingo.Actors.Tests.Supervision @@ -16,24 +16,24 @@ public class PongActor : Actor, IPong { public static ThreadLocal Instance = new ThreadLocal(); - private readonly PongTestResults testResults; + private readonly PongTestResults _testResults; public PongActor(PongTestResults testResults) { - this.testResults = testResults; + _testResults = testResults; Instance.Value = this; } public void Pong() { - testResults.Access.WriteUsing("pongCount", 1); + _testResults.Access.WriteUsing("pongCount", 1); throw new ApplicationException("Intended Pong failure."); } public override void Stop() { base.Stop(); - testResults.Access.WriteUsing("stopCount", 1); + _testResults.Access.WriteUsing("stopCount", 1); } public class PongTestResults diff --git a/src/Vlingo.Actors.Tests/Supervision/PongSupervisorActor.cs b/src/Vlingo.Actors.Tests/Supervision/PongSupervisorActor.cs index d38cd0f3..26676a3f 100644 --- a/src/Vlingo.Actors.Tests/Supervision/PongSupervisorActor.cs +++ b/src/Vlingo.Actors.Tests/Supervision/PongSupervisorActor.cs @@ -7,7 +7,7 @@ using System; using System.Threading; -using Vlingo.Common; +using Vlingo.Xoom.Common; using Vlingo.Actors.TestKit; namespace Vlingo.Actors.Tests.Supervision diff --git a/src/Vlingo.Actors.Tests/Supervision/RestartFiveInOneSupervisorActor.cs b/src/Vlingo.Actors.Tests/Supervision/RestartFiveInOneSupervisorActor.cs index 92db44d4..fd24c6af 100644 --- a/src/Vlingo.Actors.Tests/Supervision/RestartFiveInOneSupervisorActor.cs +++ b/src/Vlingo.Actors.Tests/Supervision/RestartFiveInOneSupervisorActor.cs @@ -6,7 +6,7 @@ // one at https://mozilla.org/MPL/2.0/. using System; -using Vlingo.Common; +using Vlingo.Xoom.Common; using Vlingo.Actors.TestKit; namespace Vlingo.Actors.Tests.Supervision diff --git a/src/Vlingo.Actors.Tests/Supervision/RestartForeverSupervisorActor.cs b/src/Vlingo.Actors.Tests/Supervision/RestartForeverSupervisorActor.cs index 1e042222..36bc17c3 100644 --- a/src/Vlingo.Actors.Tests/Supervision/RestartForeverSupervisorActor.cs +++ b/src/Vlingo.Actors.Tests/Supervision/RestartForeverSupervisorActor.cs @@ -6,7 +6,7 @@ // one at https://mozilla.org/MPL/2.0/. using System; -using Vlingo.Common; +using Vlingo.Xoom.Common; using Vlingo.Actors.TestKit; namespace Vlingo.Actors.Tests.Supervision diff --git a/src/Vlingo.Actors.Tests/Supervision/ResumeForeverSupervisorActor.cs b/src/Vlingo.Actors.Tests/Supervision/ResumeForeverSupervisorActor.cs index aec80aab..9afd7ab0 100644 --- a/src/Vlingo.Actors.Tests/Supervision/ResumeForeverSupervisorActor.cs +++ b/src/Vlingo.Actors.Tests/Supervision/ResumeForeverSupervisorActor.cs @@ -6,19 +6,16 @@ // one at https://mozilla.org/MPL/2.0/. using System; -using Vlingo.Common; +using Vlingo.Xoom.Common; using Vlingo.Actors.TestKit; namespace Vlingo.Actors.Tests.Supervision { public class ResumeForeverSupervisorActor : Actor, ISupervisor { - private readonly ResumeForeverSupervisorTestResults testResults; + private readonly ResumeForeverSupervisorTestResults _testResults; - public ResumeForeverSupervisorActor(ResumeForeverSupervisorTestResults testResults) - { - this.testResults = testResults; - } + public ResumeForeverSupervisorActor(ResumeForeverSupervisorTestResults testResults) => _testResults = testResults; public ISupervisionStrategy SupervisionStrategy { get; } = new SupervisionStrategyImpl(); @@ -26,8 +23,8 @@ public ResumeForeverSupervisorActor(ResumeForeverSupervisorTestResults testResul public void Inform(Exception error, ISupervised supervised) { - testResults.Access.WriteUsing("informedCount", 1); - if(testResults.Access.ReadFrom("informedCount") == 1) + _testResults.Access.WriteUsing("informedCount", 1); + if(_testResults.Access.ReadFrom("informedCount") == 1) { supervised.RestartWithin(SupervisionStrategy.Period, SupervisionStrategy.Intensity, SupervisionStrategy.Scope); } diff --git a/src/Vlingo.Actors.Tests/Supervision/StopAllSupervisorActor.cs b/src/Vlingo.Actors.Tests/Supervision/StopAllSupervisorActor.cs index 5d0feb99..86268d2c 100644 --- a/src/Vlingo.Actors.Tests/Supervision/StopAllSupervisorActor.cs +++ b/src/Vlingo.Actors.Tests/Supervision/StopAllSupervisorActor.cs @@ -8,19 +8,19 @@ using System; using System.Threading; using Vlingo.Actors.TestKit; -using Vlingo.Common; +using Vlingo.Xoom.Common; namespace Vlingo.Actors.Tests.Supervision { public class StopAllSupervisorActor : Actor, ISupervisor { public static readonly ThreadLocal Instance = new ThreadLocal(); - private readonly StopAllSupervisorResult result; + private readonly StopAllSupervisorResult _result; public StopAllSupervisorActor(StopAllSupervisorResult result) { Instance.Value = this; - this.result = result; + _result = result; } public ISupervisionStrategy SupervisionStrategy { get; } = new SupervisionStrategyImpl(); @@ -30,7 +30,7 @@ public StopAllSupervisorActor(StopAllSupervisorResult result) public void Inform(Exception error, ISupervised supervised) { supervised.Stop(SupervisionStrategy.Scope); - result.Access.WriteUsing("informedCount", 1); + _result.Access.WriteUsing("informedCount", 1); } private class SupervisionStrategyImpl : ISupervisionStrategy diff --git a/src/Vlingo.Actors.Tests/Supervision/SuspendedSenderSupervisorActor.cs b/src/Vlingo.Actors.Tests/Supervision/SuspendedSenderSupervisorActor.cs index 5b1b84dd..332da9a6 100644 --- a/src/Vlingo.Actors.Tests/Supervision/SuspendedSenderSupervisorActor.cs +++ b/src/Vlingo.Actors.Tests/Supervision/SuspendedSenderSupervisorActor.cs @@ -7,7 +7,7 @@ using System; using System.Threading; -using Vlingo.Common; +using Vlingo.Xoom.Common; using Vlingo.Actors.TestKit; namespace Vlingo.Actors.Tests.Supervision @@ -15,14 +15,14 @@ namespace Vlingo.Actors.Tests.Supervision public class SuspendedSenderSupervisorActor : Actor, ISupervisor, IFailureControlSender { public static readonly ThreadLocal Instance = new ThreadLocal(); - private readonly SuspendedSenderSupervisorResults results; - private IFailureControl failureControl; - private int times; + private readonly SuspendedSenderSupervisorResults _results; + private IFailureControl _failureControl; + private int _times; public SuspendedSenderSupervisorActor(SuspendedSenderSupervisorResults results) { Instance.Value = this; - this.results = results; + _results = results; } public ISupervisionStrategy SupervisionStrategy { get; } = new SupervisionStrategyImpl(); @@ -32,18 +32,18 @@ public SuspendedSenderSupervisorActor(SuspendedSenderSupervisorResults results) public void Inform(Exception error, ISupervised supervised) { - for (var idx = 1; idx <= times; ++idx) + for (var idx = 1; idx <= _times; ++idx) { - failureControl.AfterFailureCount(idx); + _failureControl.AfterFailureCount(idx); } supervised.Resume(); - results.Access.WriteUsing("informedCount", 1); + _results.Access.WriteUsing("informedCount", 1); } public void SendUsing(IFailureControl failureControl, int times) { - this.failureControl = failureControl; - this.times = times; + _failureControl = failureControl; + _times = times; } private class SupervisionStrategyImpl : ISupervisionStrategy @@ -58,7 +58,7 @@ private class SupervisionStrategyImpl : ISupervisionStrategy public class SuspendedSenderSupervisorResults { public AccessSafely Access { get; private set; } - public AtomicInteger informedCount = new AtomicInteger(0); + public AtomicInteger InformedCount = new AtomicInteger(0); public SuspendedSenderSupervisorResults() { @@ -69,8 +69,8 @@ public AccessSafely AfterCompleting(int times) { Access = AccessSafely .AfterCompleting(times) - .WritingWith("informedCount", (int increment) => informedCount.Set(informedCount.Get() + increment)) - .ReadingWith("informedCount", () => informedCount.Get()); + .WritingWith("informedCount", (int increment) => InformedCount.Set(InformedCount.Get() + increment)) + .ReadingWith("informedCount", () => InformedCount.Get()); return Access; } } diff --git a/src/Vlingo.Actors.Tests/TaskActorProtocolTest.cs b/src/Vlingo.Actors.Tests/TaskActorProtocolTest.cs index 377aad5e..c712480f 100644 --- a/src/Vlingo.Actors.Tests/TaskActorProtocolTest.cs +++ b/src/Vlingo.Actors.Tests/TaskActorProtocolTest.cs @@ -8,7 +8,7 @@ using System; using System.Threading; using System.Threading.Tasks; -using Vlingo.Common; +using Vlingo.Xoom.Common; using Xunit; namespace Vlingo.Actors.Tests diff --git a/src/Vlingo.Actors.Tests/WorldTest.cs b/src/Vlingo.Actors.Tests/WorldTest.cs index 4c41c0c7..4c4c4253 100644 --- a/src/Vlingo.Actors.Tests/WorldTest.cs +++ b/src/Vlingo.Actors.Tests/WorldTest.cs @@ -7,7 +7,7 @@ using NSubstitute; using System; -using Vlingo.Common; +using Vlingo.Xoom.Common; using Vlingo.Actors.TestKit; using Xunit; diff --git a/src/Vlingo.Actors/Actor.cs b/src/Vlingo.Actors/Actor.cs index c385889b..58d5bcc9 100644 --- a/src/Vlingo.Actors/Actor.cs +++ b/src/Vlingo.Actors/Actor.cs @@ -9,7 +9,7 @@ using System.Linq.Expressions; using System.Reflection; using Vlingo.Actors.TestKit; -using Vlingo.Common; +using Vlingo.Xoom.Common; namespace Vlingo.Actors { diff --git a/src/Vlingo.Actors/BasicAddressFactory.cs b/src/Vlingo.Actors/BasicAddressFactory.cs index 4b0346e3..cbda4d12 100644 --- a/src/Vlingo.Actors/BasicAddressFactory.cs +++ b/src/Vlingo.Actors/BasicAddressFactory.cs @@ -5,7 +5,7 @@ // was not distributed with this file, You can obtain // one at https://mozilla.org/MPL/2.0/. -using Vlingo.Common; +using Vlingo.Xoom.Common; namespace Vlingo.Actors { diff --git a/src/Vlingo.Actors/BroadcastRouter.cs b/src/Vlingo.Actors/BroadcastRouter.cs index d79d6079..c873bd32 100644 --- a/src/Vlingo.Actors/BroadcastRouter.cs +++ b/src/Vlingo.Actors/BroadcastRouter.cs @@ -6,7 +6,7 @@ // one at https://mozilla.org/MPL/2.0/. using System; -using Vlingo.Common; +using Vlingo.Xoom.Common; namespace Vlingo.Actors { diff --git a/src/Vlingo.Actors/Cancellable__Proxy.cs b/src/Vlingo.Actors/Cancellable__Proxy.cs index 16ef853d..f1378e79 100644 --- a/src/Vlingo.Actors/Cancellable__Proxy.cs +++ b/src/Vlingo.Actors/Cancellable__Proxy.cs @@ -6,7 +6,7 @@ // one at https://mozilla.org/MPL/2.0/. using System; -using Vlingo.Common; +using Vlingo.Xoom.Common; namespace Vlingo.Actors { diff --git a/src/Vlingo.Actors/CompletionSupplier.cs b/src/Vlingo.Actors/CompletionSupplier.cs index 2aba9e72..ff9788cb 100644 --- a/src/Vlingo.Actors/CompletionSupplier.cs +++ b/src/Vlingo.Actors/CompletionSupplier.cs @@ -6,7 +6,7 @@ // one at https://mozilla.org/MPL/2.0/. using System; -using Vlingo.Common; +using Vlingo.Xoom.Common; namespace Vlingo.Actors { diff --git a/src/Vlingo.Actors/CompletionTranslator.cs b/src/Vlingo.Actors/CompletionTranslator.cs index fa9c24d2..0efec419 100644 --- a/src/Vlingo.Actors/CompletionTranslator.cs +++ b/src/Vlingo.Actors/CompletionTranslator.cs @@ -6,7 +6,7 @@ // one at https://mozilla.org/MPL/2.0/. using System; -using Vlingo.Common; +using Vlingo.Xoom.Common; namespace Vlingo.Actors { diff --git a/src/Vlingo.Actors/DirectoryEvictor.cs b/src/Vlingo.Actors/DirectoryEvictor.cs index 98674cf3..9d616af2 100644 --- a/src/Vlingo.Actors/DirectoryEvictor.cs +++ b/src/Vlingo.Actors/DirectoryEvictor.cs @@ -8,14 +8,14 @@ using System.Diagnostics; using System.Linq; using Vlingo.Actors.Plugin.Eviction; -using Vlingo.Common; +using Vlingo.Xoom.Common; namespace Vlingo.Actors { internal class DirectoryEvictor : Actor, IScheduled { - private readonly DirectoryEvictionConfiguration config; - private readonly Directory directory; + private readonly DirectoryEvictionConfiguration _config; + private readonly Directory _directory; public DirectoryEvictor(Directory directory) : this(new DirectoryEvictionConfiguration(), directory) { @@ -23,8 +23,8 @@ public DirectoryEvictor(Directory directory) : this(new DirectoryEvictionConfigu public DirectoryEvictor(DirectoryEvictionConfiguration config, Directory directory) { - this.config = config; - this.directory = directory; + _config = config; + _directory = directory; Logger.Debug("Created with config: {}", config); } @@ -33,18 +33,18 @@ public void IntervalSignal(IScheduled scheduled, object data) Logger.Debug("Started eviction routine"); var currentProcess = Process.GetCurrentProcess(); var fillRatio = currentProcess.PrivateMemorySize64 / (float) currentProcess.WorkingSet64; - if (fillRatio >= config.FillRatioHigh) + if (fillRatio >= _config.FillRatioHigh) { - Logger.Debug($"Memory fill ratio {fillRatio} exceeding watermark ({config.FillRatioHigh})"); - var evicted = directory.EvictionCandidates(config.LruThresholdMillis) - .Where(actor => actor.LifeCycle.Evictable.Stop(config.LruThresholdMillis)) + Logger.Debug($"Memory fill ratio {fillRatio} exceeding watermark ({_config.FillRatioHigh})"); + var evicted = _directory.EvictionCandidates(_config.LruThresholdMillis) + .Where(actor => actor.LifeCycle.Evictable.Stop(_config.LruThresholdMillis)) .Select(actor => actor.Address) .ToArray(); Logger.Debug($"Evicted {evicted.Length} actors :: {evicted}"); } else { - Logger.Debug($"Memory fill ratio {fillRatio} was below watermark ({config.FillRatioHigh})"); + Logger.Debug($"Memory fill ratio {fillRatio} was below watermark ({_config.FillRatioHigh})"); } } } diff --git a/src/Vlingo.Actors/DirectoryScannerActor.cs b/src/Vlingo.Actors/DirectoryScannerActor.cs index b377971d..fea6bfb0 100644 --- a/src/Vlingo.Actors/DirectoryScannerActor.cs +++ b/src/Vlingo.Actors/DirectoryScannerActor.cs @@ -6,18 +6,15 @@ // one at https://mozilla.org/MPL/2.0/. using System; -using Vlingo.Common; +using Vlingo.Xoom.Common; namespace Vlingo.Actors { internal class DirectoryScannerActor : Actor, IDirectoryScanner { - private readonly Directory directory; + private readonly Directory _directory; - public DirectoryScannerActor(Directory directory) - { - this.directory = directory; - } + public DirectoryScannerActor(Directory directory) => _directory = directory; public ICompletes ActorOf(IAddress address) => Completes().With(InternalActorOf(address)); @@ -31,7 +28,7 @@ public ICompletes> MaybeActorOf(IAddress address) private T InternalActorOf(IAddress address) { - var actor = directory.ActorOf(address); + var actor = _directory.ActorOf(address); try { if(actor != null) diff --git a/src/Vlingo.Actors/DirectoryScanner__Proxy.cs b/src/Vlingo.Actors/DirectoryScanner__Proxy.cs index 2c1eb15a..87328892 100644 --- a/src/Vlingo.Actors/DirectoryScanner__Proxy.cs +++ b/src/Vlingo.Actors/DirectoryScanner__Proxy.cs @@ -6,7 +6,7 @@ // one at https://mozilla.org/MPL/2.0/. using System; -using Vlingo.Common; +using Vlingo.Xoom.Common; namespace Vlingo.Actors { diff --git a/src/Vlingo.Actors/Environment.cs b/src/Vlingo.Actors/Environment.cs index 2e3eeada..21fe0cba 100644 --- a/src/Vlingo.Actors/Environment.cs +++ b/src/Vlingo.Actors/Environment.cs @@ -9,7 +9,7 @@ using System.Collections.Concurrent; using System.Collections.Generic; using System.Linq; -using Vlingo.Common; +using Vlingo.Xoom.Common; namespace Vlingo.Actors { diff --git a/src/Vlingo.Actors/Evictable.cs b/src/Vlingo.Actors/Evictable.cs index a0f46876..341394d8 100644 --- a/src/Vlingo.Actors/Evictable.cs +++ b/src/Vlingo.Actors/Evictable.cs @@ -5,7 +5,7 @@ // was not distributed with this file, You can obtain // one at https://mozilla.org/MPL/2.0/. -using Vlingo.Common; +using Vlingo.Xoom.Common; namespace Vlingo.Actors { diff --git a/src/Vlingo.Actors/FailureMark.cs b/src/Vlingo.Actors/FailureMark.cs index b6e1f3b3..91bef6c2 100644 --- a/src/Vlingo.Actors/FailureMark.cs +++ b/src/Vlingo.Actors/FailureMark.cs @@ -5,7 +5,7 @@ // was not distributed with this file, You can obtain // one at https://mozilla.org/MPL/2.0/. -using Vlingo.Common; +using Vlingo.Xoom.Common; namespace Vlingo.Actors { diff --git a/src/Vlingo.Actors/GuidAddressFactory.cs b/src/Vlingo.Actors/GuidAddressFactory.cs index d10c009c..0c103a24 100644 --- a/src/Vlingo.Actors/GuidAddressFactory.cs +++ b/src/Vlingo.Actors/GuidAddressFactory.cs @@ -6,8 +6,8 @@ // one at https://mozilla.org/MPL/2.0/. using System; -using Vlingo.Common; -using Vlingo.Common.Identity; +using Vlingo.Xoom.Common; +using Vlingo.Xoom.Common.Identity; using Vlingo.Xoom.UUID; namespace Vlingo.Actors @@ -19,7 +19,7 @@ public class GuidAddressFactory : IAddressFactory private readonly IIdentityGenerator _generator; private IdentityGeneratorType _type; - private AtomicLong _highId; + private readonly AtomicLong _highId; public GuidAddressFactory(IdentityGeneratorType type) { diff --git a/src/Vlingo.Actors/ICompletesEventuallyProvider.cs b/src/Vlingo.Actors/ICompletesEventuallyProvider.cs index db99ac11..31a84125 100644 --- a/src/Vlingo.Actors/ICompletesEventuallyProvider.cs +++ b/src/Vlingo.Actors/ICompletesEventuallyProvider.cs @@ -5,7 +5,7 @@ // was not distributed with this file, You can obtain // one at https://mozilla.org/MPL/2.0/. -using Vlingo.Common; +using Vlingo.Xoom.Common; namespace Vlingo.Actors { diff --git a/src/Vlingo.Actors/IDirectoryScanner.cs b/src/Vlingo.Actors/IDirectoryScanner.cs index 49fdbe31..01987da8 100644 --- a/src/Vlingo.Actors/IDirectoryScanner.cs +++ b/src/Vlingo.Actors/IDirectoryScanner.cs @@ -5,7 +5,7 @@ // was not distributed with this file, You can obtain // one at https://mozilla.org/MPL/2.0/. -using Vlingo.Common; +using Vlingo.Xoom.Common; namespace Vlingo.Actors { diff --git a/src/Vlingo.Actors/IMailbox.cs b/src/Vlingo.Actors/IMailbox.cs index 0a71989b..bda10240 100644 --- a/src/Vlingo.Actors/IMailbox.cs +++ b/src/Vlingo.Actors/IMailbox.cs @@ -7,7 +7,7 @@ using System; using System.Threading.Tasks; -using Vlingo.Common; +using Vlingo.Xoom.Common; namespace Vlingo.Actors { diff --git a/src/Vlingo.Actors/IMessage.cs b/src/Vlingo.Actors/IMessage.cs index b45d5244..070a194e 100644 --- a/src/Vlingo.Actors/IMessage.cs +++ b/src/Vlingo.Actors/IMessage.cs @@ -6,7 +6,7 @@ // one at https://mozilla.org/MPL/2.0/. using System; -using Vlingo.Common; +using Vlingo.Xoom.Common; namespace Vlingo.Actors { diff --git a/src/Vlingo.Actors/LocalMessage.cs b/src/Vlingo.Actors/LocalMessage.cs index 44610193..ca022f89 100644 --- a/src/Vlingo.Actors/LocalMessage.cs +++ b/src/Vlingo.Actors/LocalMessage.cs @@ -6,7 +6,7 @@ // one at https://mozilla.org/MPL/2.0/. using System; -using Vlingo.Common; +using Vlingo.Xoom.Common; namespace Vlingo.Actors { diff --git a/src/Vlingo.Actors/Plugin/Completes/CompletesEventuallyPool.cs b/src/Vlingo.Actors/Plugin/Completes/CompletesEventuallyPool.cs index 6c38d123..02420cd4 100644 --- a/src/Vlingo.Actors/Plugin/Completes/CompletesEventuallyPool.cs +++ b/src/Vlingo.Actors/Plugin/Completes/CompletesEventuallyPool.cs @@ -5,30 +5,30 @@ // was not distributed with this file, You can obtain // one at https://mozilla.org/MPL/2.0/. -using Vlingo.Common; +using Vlingo.Xoom.Common; namespace Vlingo.Actors.Plugin.Completes { public class CompletesEventuallyPool : ICompletesEventuallyProvider { - private readonly AtomicLong completesEventuallyId; - private readonly ICompletesEventually[] pool; - private readonly AtomicLong poolIndex; - private readonly long poolSize; - private readonly string mailboxName; + private readonly AtomicLong _completesEventuallyId; + private readonly ICompletesEventually[] _pool; + private readonly AtomicLong _poolIndex; + private readonly long _poolSize; + private readonly string _mailboxName; public CompletesEventuallyPool(int poolSize, string mailboxName) { - completesEventuallyId = new AtomicLong(0); - this.poolSize = poolSize; - this.mailboxName = mailboxName; - poolIndex = new AtomicLong(0); - pool = new ICompletesEventually[poolSize]; + _completesEventuallyId = new AtomicLong(0); + this._poolSize = poolSize; + this._mailboxName = mailboxName; + _poolIndex = new AtomicLong(0); + _pool = new ICompletesEventually[poolSize]; } public void Close() { - foreach(var completes in pool) + foreach(var completes in _pool) { completes.Stop(); } @@ -38,38 +38,38 @@ public ICompletesEventually CompletesEventually { get { - int index = (int)(poolIndex.IncrementAndGet() % poolSize); - return pool[index]; + int index = (int)(_poolIndex.IncrementAndGet() % _poolSize); + return _pool[index]; } } public void InitializeUsing(Stage stage) { - for (var idx = 0; idx < poolSize; ++idx) + for (var idx = 0; idx < _poolSize; ++idx) { - pool[idx] = stage.ActorFor( + _pool[idx] = stage.ActorFor( Definition.Has( Definition.NoParameters, - mailboxName, + _mailboxName, "completes-eventually-" + (idx + 1))); } } public ICompletesEventually ProvideCompletesFor(ICompletes? clientCompletes) => new PooledCompletes( - completesEventuallyId.GetAndIncrement(), + _completesEventuallyId.GetAndIncrement(), clientCompletes, CompletesEventually); public ICompletesEventually ProvideCompletesFor(IAddress address, ICompletes? clientCompletes) => new PooledCompletes( - completesEventuallyId.GetAndIncrement(), + _completesEventuallyId.GetAndIncrement(), clientCompletes, CompletesEventuallyOf(address)); private ICompletesEventually CompletesEventuallyOf(IAddress address) { - foreach (var completesEventually in pool) + foreach (var completesEventually in _pool) { if (completesEventually.Address.Equals(address)) { diff --git a/src/Vlingo.Actors/Plugin/Mailbox/AgronaMPSCArrayQueue/ManyToOneConcurrentArrayQueueDispatcher.cs b/src/Vlingo.Actors/Plugin/Mailbox/AgronaMPSCArrayQueue/ManyToOneConcurrentArrayQueueDispatcher.cs index f56504fc..528163f0 100644 --- a/src/Vlingo.Actors/Plugin/Mailbox/AgronaMPSCArrayQueue/ManyToOneConcurrentArrayQueueDispatcher.cs +++ b/src/Vlingo.Actors/Plugin/Mailbox/AgronaMPSCArrayQueue/ManyToOneConcurrentArrayQueueDispatcher.cs @@ -7,7 +7,7 @@ using System.Threading; using System.Threading.Tasks; -using Vlingo.Common; +using Vlingo.Xoom.Common; namespace Vlingo.Actors.Plugin.Mailbox.AgronaMPSCArrayQueue { diff --git a/src/Vlingo.Actors/Plugin/Mailbox/AgronaMPSCArrayQueue/ManyToOneConcurrentArrayQueueMailbox.cs b/src/Vlingo.Actors/Plugin/Mailbox/AgronaMPSCArrayQueue/ManyToOneConcurrentArrayQueueMailbox.cs index 56085976..7e49d51d 100644 --- a/src/Vlingo.Actors/Plugin/Mailbox/AgronaMPSCArrayQueue/ManyToOneConcurrentArrayQueueMailbox.cs +++ b/src/Vlingo.Actors/Plugin/Mailbox/AgronaMPSCArrayQueue/ManyToOneConcurrentArrayQueueMailbox.cs @@ -8,7 +8,7 @@ using System; using System.Collections.Concurrent; using System.Threading.Tasks; -using Vlingo.Common; +using Vlingo.Xoom.Common; namespace Vlingo.Actors.Plugin.Mailbox.AgronaMPSCArrayQueue { diff --git a/src/Vlingo.Actors/Plugin/Mailbox/ConcurrentQueue/ConcurrentQueueMailbox.cs b/src/Vlingo.Actors/Plugin/Mailbox/ConcurrentQueue/ConcurrentQueueMailbox.cs index 78604d5a..5375a8ea 100644 --- a/src/Vlingo.Actors/Plugin/Mailbox/ConcurrentQueue/ConcurrentQueueMailbox.cs +++ b/src/Vlingo.Actors/Plugin/Mailbox/ConcurrentQueue/ConcurrentQueueMailbox.cs @@ -10,7 +10,7 @@ using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; -using Vlingo.Common; +using Vlingo.Xoom.Common; namespace Vlingo.Actors.Plugin.Mailbox.ConcurrentQueue { diff --git a/src/Vlingo.Actors/Plugin/Mailbox/ConcurrentQueue/ExecutorDispatcher.cs b/src/Vlingo.Actors/Plugin/Mailbox/ConcurrentQueue/ExecutorDispatcher.cs index c3005e66..3c6c68af 100644 --- a/src/Vlingo.Actors/Plugin/Mailbox/ConcurrentQueue/ExecutorDispatcher.cs +++ b/src/Vlingo.Actors/Plugin/Mailbox/ConcurrentQueue/ExecutorDispatcher.cs @@ -6,7 +6,7 @@ // one at https://mozilla.org/MPL/2.0/. using System; -using Vlingo.Common; +using Vlingo.Xoom.Common; namespace Vlingo.Actors.Plugin.Mailbox.ConcurrentQueue { diff --git a/src/Vlingo.Actors/Plugin/Mailbox/ConcurrentQueue/ThreadPoolExecutor.cs b/src/Vlingo.Actors/Plugin/Mailbox/ConcurrentQueue/ThreadPoolExecutor.cs index 234bfdda..4d8c6c7a 100644 --- a/src/Vlingo.Actors/Plugin/Mailbox/ConcurrentQueue/ThreadPoolExecutor.cs +++ b/src/Vlingo.Actors/Plugin/Mailbox/ConcurrentQueue/ThreadPoolExecutor.cs @@ -8,7 +8,7 @@ using System; using System.Collections.Concurrent; using System.Threading; -using Vlingo.Common; +using Vlingo.Xoom.Common; namespace Vlingo.Actors.Plugin.Mailbox.ConcurrentQueue { diff --git a/src/Vlingo.Actors/Plugin/Mailbox/SharedRingBuffer/RingBufferDispatcher.cs b/src/Vlingo.Actors/Plugin/Mailbox/SharedRingBuffer/RingBufferDispatcher.cs index 2a2ca3cc..b552d707 100644 --- a/src/Vlingo.Actors/Plugin/Mailbox/SharedRingBuffer/RingBufferDispatcher.cs +++ b/src/Vlingo.Actors/Plugin/Mailbox/SharedRingBuffer/RingBufferDispatcher.cs @@ -8,7 +8,7 @@ using System; using System.Threading; using System.Threading.Tasks; -using Vlingo.Common; +using Vlingo.Xoom.Common; namespace Vlingo.Actors.Plugin.Mailbox.SharedRingBuffer { diff --git a/src/Vlingo.Actors/Plugin/Mailbox/SharedRingBuffer/SharedRingBufferMailbox.cs b/src/Vlingo.Actors/Plugin/Mailbox/SharedRingBuffer/SharedRingBufferMailbox.cs index b271eb17..32157028 100644 --- a/src/Vlingo.Actors/Plugin/Mailbox/SharedRingBuffer/SharedRingBufferMailbox.cs +++ b/src/Vlingo.Actors/Plugin/Mailbox/SharedRingBuffer/SharedRingBufferMailbox.cs @@ -7,7 +7,7 @@ using System; using System.Threading.Tasks; -using Vlingo.Common; +using Vlingo.Xoom.Common; namespace Vlingo.Actors.Plugin.Mailbox.SharedRingBuffer { diff --git a/src/Vlingo.Actors/Plugin/Mailbox/TestKit/TestMailbox.cs b/src/Vlingo.Actors/Plugin/Mailbox/TestKit/TestMailbox.cs index 27fb0250..b6053192 100644 --- a/src/Vlingo.Actors/Plugin/Mailbox/TestKit/TestMailbox.cs +++ b/src/Vlingo.Actors/Plugin/Mailbox/TestKit/TestMailbox.cs @@ -11,7 +11,7 @@ using System.Linq; using System.Threading.Tasks; using Vlingo.Actors.TestKit; -using Vlingo.Common; +using Vlingo.Xoom.Common; namespace Vlingo.Actors.Plugin.Mailbox.TestKit { diff --git a/src/Vlingo.Actors/PooledCompletes.cs b/src/Vlingo.Actors/PooledCompletes.cs index a4def487..c2aa8cba 100644 --- a/src/Vlingo.Actors/PooledCompletes.cs +++ b/src/Vlingo.Actors/PooledCompletes.cs @@ -5,7 +5,7 @@ // was not distributed with this file, You can obtain // one at https://mozilla.org/MPL/2.0/. -using Vlingo.Common; +using Vlingo.Xoom.Common; namespace Vlingo.Actors { diff --git a/src/Vlingo.Actors/Properties.cs b/src/Vlingo.Actors/Properties.cs index fc3e9f9b..6fc8e2d7 100644 --- a/src/Vlingo.Actors/Properties.cs +++ b/src/Vlingo.Actors/Properties.cs @@ -7,7 +7,7 @@ using System; using System.IO; -using Vlingo.Common; +using Vlingo.Xoom.Common; namespace Vlingo.Actors { diff --git a/src/Vlingo.Actors/ProxyGenerator.cs b/src/Vlingo.Actors/ProxyGenerator.cs index de75501f..ee2b324f 100644 --- a/src/Vlingo.Actors/ProxyGenerator.cs +++ b/src/Vlingo.Actors/ProxyGenerator.cs @@ -12,11 +12,11 @@ using System.Reflection; using System.Text; using System.Threading.Tasks; -using Vlingo.Common; -using Vlingo.Common.Compiler; +using Vlingo.Xoom.Common; +using Vlingo.Xoom.Common.Compiler; -using static Vlingo.Common.Compiler.DynaFile; -using static Vlingo.Common.Compiler.DynaNaming; +using static Vlingo.Xoom.Common.Compiler.DynaFile; +using static Vlingo.Xoom.Common.Compiler.DynaNaming; namespace Vlingo.Actors { diff --git a/src/Vlingo.Actors/ResultCompletes.cs b/src/Vlingo.Actors/ResultCompletes.cs index 1d4ea4fb..7e59d79e 100644 --- a/src/Vlingo.Actors/ResultCompletes.cs +++ b/src/Vlingo.Actors/ResultCompletes.cs @@ -7,8 +7,8 @@ using System; using System.Threading.Tasks; -using Vlingo.Common; -using Vlingo.Common.Completion.Tasks; +using Vlingo.Xoom.Common; +using Vlingo.Xoom.Common.Completion.Tasks; namespace Vlingo.Actors { @@ -45,7 +45,7 @@ internal bool HasInternalOutcomeSet internal class ResultCompletes : ResultCompletes, ICompletes { - private ICompletes _completes = Common.Completes.Using(new Scheduler()); + private ICompletes _completes = Xoom.Common.Completes.Using(new Scheduler()); public bool IsCompleted => Completes().IsCompleted; diff --git a/src/Vlingo.Actors/ResumingMailbox.cs b/src/Vlingo.Actors/ResumingMailbox.cs index 1aca8190..2432cadc 100644 --- a/src/Vlingo.Actors/ResumingMailbox.cs +++ b/src/Vlingo.Actors/ResumingMailbox.cs @@ -7,7 +7,7 @@ using System; using System.Threading.Tasks; -using Vlingo.Common; +using Vlingo.Xoom.Common; namespace Vlingo.Actors { diff --git a/src/Vlingo.Actors/Routee.cs b/src/Vlingo.Actors/Routee.cs index 777ec995..f13356db 100644 --- a/src/Vlingo.Actors/Routee.cs +++ b/src/Vlingo.Actors/Routee.cs @@ -6,7 +6,7 @@ // one at https://mozilla.org/MPL/2.0/. using System; -using Vlingo.Common; +using Vlingo.Xoom.Common; namespace Vlingo.Actors { diff --git a/src/Vlingo.Actors/Router.cs b/src/Vlingo.Actors/Router.cs index 5a05208d..097ae21b 100644 --- a/src/Vlingo.Actors/Router.cs +++ b/src/Vlingo.Actors/Router.cs @@ -8,7 +8,7 @@ using System; using System.Collections.Generic; using System.Linq; -using Vlingo.Common; +using Vlingo.Xoom.Common; namespace Vlingo.Actors { diff --git a/src/Vlingo.Actors/Scheduled__Proxy.cs b/src/Vlingo.Actors/Scheduled__Proxy.cs index 5d022fe4..90c22be9 100644 --- a/src/Vlingo.Actors/Scheduled__Proxy.cs +++ b/src/Vlingo.Actors/Scheduled__Proxy.cs @@ -1,8 +1,6 @@ using System; -using System.Collections.Generic; -using System.Threading.Tasks; using Vlingo.Actors; -using Vlingo.Common; +using Vlingo.Xoom.Common; namespace Vlingo.Common { diff --git a/src/Vlingo.Actors/Stage.cs b/src/Vlingo.Actors/Stage.cs index 9f3f129b..0339fda3 100644 --- a/src/Vlingo.Actors/Stage.cs +++ b/src/Vlingo.Actors/Stage.cs @@ -12,7 +12,7 @@ using System.Threading; using Vlingo.Actors.Plugin.Mailbox.TestKit; using Vlingo.Actors.TestKit; -using Vlingo.Common; +using Vlingo.Xoom.Common; namespace Vlingo.Actors { diff --git a/src/Vlingo.Actors/StowedLocalMessage.cs b/src/Vlingo.Actors/StowedLocalMessage.cs index 1641b8ee..d8f10dc9 100644 --- a/src/Vlingo.Actors/StowedLocalMessage.cs +++ b/src/Vlingo.Actors/StowedLocalMessage.cs @@ -6,7 +6,7 @@ // one at https://mozilla.org/MPL/2.0/. using System; -using Vlingo.Common; +using Vlingo.Xoom.Common; namespace Vlingo.Actors { diff --git a/src/Vlingo.Actors/TestKit/AccessSafely.cs b/src/Vlingo.Actors/TestKit/AccessSafely.cs index a05d271c..ababd7fb 100644 --- a/src/Vlingo.Actors/TestKit/AccessSafely.cs +++ b/src/Vlingo.Actors/TestKit/AccessSafely.cs @@ -8,7 +8,7 @@ using System; using System.Collections.Generic; using System.Threading; -using Vlingo.Common; +using Vlingo.Xoom.Common; namespace Vlingo.Actors.TestKit { @@ -19,34 +19,34 @@ namespace Vlingo.Actors.TestKit /// public class AccessSafely { - private readonly AtomicInteger totalWrites; - private readonly object @lock; - private readonly IDictionary biConsumers; - private readonly IDictionary consumers; - private readonly IDictionary functions; - private readonly IDictionary suppliers; - private readonly TestUntil until; + private readonly AtomicInteger _totalWrites; + private readonly object _lock; + private readonly IDictionary _biConsumers; + private readonly IDictionary _consumers; + private readonly IDictionary _functions; + private readonly IDictionary _suppliers; + private readonly TestUntil _until; private AccessSafely(AccessSafely existing, int happenings) { - totalWrites = existing.totalWrites; - until = TestUntil.Happenings(happenings); - biConsumers = existing.biConsumers; - consumers = existing.consumers; - functions = existing.functions; - suppliers = existing.suppliers; - @lock = new object(); + _totalWrites = existing._totalWrites; + _until = TestUntil.Happenings(happenings); + _biConsumers = existing._biConsumers; + _consumers = existing._consumers; + _functions = existing._functions; + _suppliers = existing._suppliers; + _lock = new object(); } private AccessSafely(int happenings) { - totalWrites = new AtomicInteger(0); - until = TestUntil.Happenings(happenings); - biConsumers = new Dictionary(); - consumers = new Dictionary(); - functions = new Dictionary(); - suppliers = new Dictionary(); - @lock = new object(); + _totalWrites = new AtomicInteger(0); + _until = TestUntil.Happenings(happenings); + _biConsumers = new Dictionary(); + _consumers = new Dictionary(); + _functions = new Dictionary(); + _suppliers = new Dictionary(); + _lock = new object(); } private AccessSafely() : this(0) @@ -55,7 +55,7 @@ private AccessSafely() : this(0) private Func GetRequiredFunction(string name) { - if (functions.TryGetValue(name, out var obj)) + if (_functions.TryGetValue(name, out var obj)) { if (obj != null) { @@ -68,7 +68,7 @@ private Func GetRequiredFunction(string name) public Func GetRequiredSupplier(string name) { - if (suppliers.TryGetValue(name, out var obj)) + if (_suppliers.TryGetValue(name, out var obj)) { if (obj != null) { @@ -114,7 +114,7 @@ public virtual AccessSafely ResetAfterCompletingTo(int happenings) /// public virtual AccessSafely ReadingWith(string name, Func function) { - functions[name] = function; + _functions[name] = function; return this; } @@ -127,7 +127,7 @@ public virtual AccessSafely ReadingWith(string name, Func function) /// public virtual AccessSafely ReadingWith(string name, Func supplier) { - suppliers[name] = supplier; + _suppliers[name] = supplier; return this; } @@ -140,7 +140,7 @@ public virtual AccessSafely ReadingWith(string name, Func supplier) /// public virtual AccessSafely ReadingWith(string name, Action supplier) { - suppliers[name] = supplier; + _suppliers[name] = supplier; return this; } @@ -152,7 +152,7 @@ public virtual AccessSafely ReadingWith(string name, Action supplier) /// public virtual AccessSafely WritingWith(string name, Action consumer) { - consumers[name] = consumer; + _consumers[name] = consumer; return this; } @@ -165,7 +165,7 @@ public virtual AccessSafely WritingWith(string name, Action consumer) /// public virtual AccessSafely WritingWith(string name, Action consumer) { - consumers[name] = consumer; + _consumers[name] = consumer; return this; } @@ -179,7 +179,7 @@ public virtual AccessSafely WritingWith(string name, Action consumer) /// public virtual AccessSafely WritingWith(string name, Action consumer) { - biConsumers[name] = consumer; + _biConsumers[name] = consumer; return this; } @@ -193,9 +193,9 @@ public virtual T ReadFrom(string name) { var supplier = GetRequiredSupplier(name); - until.Completes(); + _until.Completes(); - lock (@lock) + lock (_lock) { return supplier.Invoke(); } @@ -205,17 +205,17 @@ public virtual T ReadFrom(string name) /// Answer the value associated with . /// /// The type of the parameter to the function. - /// The type of the return value associated with the name. + /// The type of the return value associated with the name. /// The name of the value to answer. /// The typed function parameter. /// - public virtual TR ReadFrom(string name, T parameter) + public virtual Tr ReadFrom(string name, T parameter) { - var function = GetRequiredFunction(name); + var function = GetRequiredFunction(name); - until.Completes(); + _until.Completes(); - lock (@lock) + lock (_lock) { return function.Invoke(parameter); } @@ -250,7 +250,7 @@ public virtual T ReadFromExpecting(string name, T expected, long retries) { for (long count = 0; count < retries; ++count) { - lock (@lock) + lock (_lock) { value = supplier.Invoke(); if (Equals(expected, value)) @@ -280,7 +280,7 @@ public virtual T ReadFromNow(string name) { var supplier = GetRequiredSupplier(name); - lock (@lock) + lock (_lock) { return supplier.Invoke(); } @@ -298,7 +298,7 @@ public virtual R ReadFromNow(string name, T parameter) { var function = GetRequiredFunction(name); - lock (@lock) + lock (_lock) { return function.Invoke(parameter); } @@ -312,24 +312,24 @@ public virtual R ReadFromNow(string name, T parameter) /// The typed value to write. public virtual void WriteUsing(string name, T value) { - if (!consumers.ContainsKey(name)) + if (!_consumers.ContainsKey(name)) { throw new ArgumentOutOfRangeException(nameof(name), $"Unknown function: {name}"); } - lock (@lock) + lock (_lock) { - totalWrites.IncrementAndGet(); - if (consumers[name] is Action actionT) + _totalWrites.IncrementAndGet(); + if (_consumers[name] is Action actionT) { actionT!.Invoke(value); } else { - (consumers[name] as Action)!(); + (_consumers[name] as Action)!(); } - until.Happened(); + _until.Happened(); } } @@ -343,16 +343,16 @@ public virtual void WriteUsing(string name, T value) /// The typed value to write. public virtual void WriteUsing(string name, T1 value1, T2 value2) { - if (!biConsumers.ContainsKey(name)) + if (!_biConsumers.ContainsKey(name)) { throw new ArgumentOutOfRangeException(nameof(name), $"Unknown function: {name}"); } - lock (@lock) + lock (_lock) { - totalWrites.IncrementAndGet(); - (biConsumers[name] as Action)!.Invoke(value1, value2); - until.Happened(); + _totalWrites.IncrementAndGet(); + (_biConsumers[name] as Action)!.Invoke(value1, value2); + _until.Happened(); } } @@ -363,9 +363,9 @@ public virtual int TotalWrites { get { - lock (@lock) + lock (_lock) { - return totalWrites.Get(); + return _totalWrites.Get(); } } } @@ -383,9 +383,9 @@ public virtual int TotalWritesGreaterThan(int lesser, long retries) { for (long count = 0; count < retries; ++count) { - lock (@lock) + lock (_lock) { - var total = totalWrites.Get(); + var total = _totalWrites.Get(); if (total > lesser) { return total; diff --git a/src/Vlingo.Actors/TestKit/TestContext.cs b/src/Vlingo.Actors/TestKit/TestContext.cs index 8487f898..4b0154b5 100644 --- a/src/Vlingo.Actors/TestKit/TestContext.cs +++ b/src/Vlingo.Actors/TestKit/TestContext.cs @@ -5,7 +5,7 @@ // was not distributed with this file, You can obtain // one at https://mozilla.org/MPL/2.0/. -using Vlingo.Common; +using Vlingo.Xoom.Common; namespace Vlingo.Actors.TestKit { @@ -18,7 +18,7 @@ public class TestContext public TestContext(int times) { Access = AccessSafely.AfterCompleting(times); - reference = new AtomicReference(); + _reference = new AtomicReference(); SetUpWriteRead(); } @@ -43,7 +43,7 @@ public TestContext() /// public virtual TestContext InitialReferenceValueOf(T value) { - reference.Set(value); + _reference.Set(value); return this; } @@ -51,7 +51,7 @@ public virtual TestContext InitialReferenceValueOf(T value) /// A reference to any object that may be of use to the test. /// Use ReferenceValue<T>() to cast the inner object to a specific type. /// - private readonly AtomicReference reference; + private readonly AtomicReference _reference; /// /// Track number of expected happenings. Use resetHappeningsTo(n) @@ -71,7 +71,7 @@ public virtual TestContext InitialReferenceValueOf(T value) /// public virtual T ReferenceValue() { - var result = reference.Get(); + var result = _reference.Get(); if (result == null) { return default!; @@ -109,8 +109,8 @@ public virtual TestContext ResetAfterCompletingTo(int times) private void SetUpWriteRead() { Access - .WritingWith("reference", value => reference.Set(value)) - .ReadingWith("reference", () => reference.Get()); + .WritingWith("reference", value => _reference.Set(value)) + .ReadingWith("reference", () => _reference.Get()); } } } diff --git a/src/Vlingo.Actors/Vlingo.Actors.csproj b/src/Vlingo.Actors/Vlingo.Actors.csproj index fab1baf2..1818e089 100644 --- a/src/Vlingo.Actors/Vlingo.Actors.csproj +++ b/src/Vlingo.Actors/Vlingo.Actors.csproj @@ -33,12 +33,12 @@ - + - + diff --git a/src/Vlingo.Actors/World.cs b/src/Vlingo.Actors/World.cs index addf3934..7d5cf5a7 100644 --- a/src/Vlingo.Actors/World.cs +++ b/src/Vlingo.Actors/World.cs @@ -12,8 +12,8 @@ using Vlingo.Actors.Plugin.Completes; using Vlingo.Actors.Plugin.Logging; using Vlingo.Actors.Plugin.Mailbox; -using Vlingo.Common; -using Vlingo.Common.Compiler; +using Vlingo.Xoom.Common; +using Vlingo.Xoom.Common.Compiler; namespace Vlingo.Actors {