Skip to content
Permalink
Browse files

Refactor - segregate platform implementation details from execution e…

…ngine
  • Loading branch information...
tyrotoxin committed Oct 20, 2018
1 parent b1fd37c commit b39acd35ced93f84286e4715553e44d16696cc95
Showing with 445 additions and 218 deletions.
  1. +2 −1 .gitignore
  2. +1 −2 Azure/Connector.Storage/AzureStorageFabricConnector.cs
  3. +1 −1 Azure/Connector.Storage/AzureStorageFabricConnectorFactory.cs
  4. +1 −1 Azure/Connector.Storage/DI.cs
  5. +4 −0 Azure/Connector.Storage/Dasync.FabricConnector.AzureStorage.Fx450.csproj
  6. +2 −1 Azure/Connector.Storage/Dasync.FabricConnector.AzureStorage.csproj
  7. +3 −4 Azure/Functions/Fabric/AzureFunctionsFabric.cs
  8. +7 −6 Azure/Functions/Fabric/AzureStorageTransitionCarrier.cs
  9. +1 −2 Azure/Functions/Fabric/DI.cs
  10. +4 −0 Azure/Functions/Fabric/Dasync.Fabric.AzureFunctions.Fx460.csproj
  11. +1 −1 Azure/Functions/Fabric/GlobalStartup.cs
  12. +7 −0 Dasync.NetFx.sln
  13. +7 −0 Dasync.sln
  14. +6 −0 Engine/Accessors/ContinuationWrapperAccessor.cs
  15. +4 −12 Engine/EETypes/Dasync.EETypes.Fx450.csproj
  16. +4 −11 Engine/EETypes/Dasync.EETypes.Fx460.csproj
  17. +2 −2 Engine/EETypes/{Transitions → Engine}/ITransitionRunner.cs
  18. +5 −0 Engine/EETypes/Intents/ExecuteRoutineIntent.cs
  19. +2 −1 Engine/EETypes/Intents/SaveStateIntent.cs
  20. +4 −3 Engine/EETypes/Intents/ScheduledActions.cs
  21. +10 −0 Engine/EETypes/Platform/IRoutineCompletionNotifier.cs
  22. +5 −2 Engine/EETypes/{Transitions/ITransitionData.cs → Platform/ITransitionCarrier.cs}
  23. +18 −0 Engine/EETypes/Platform/ITransitionCommitter.cs
  24. +2 −9 Engine/ExecutionEngine/DI.cs
  25. +1 −5 Engine/ExecutionEngine/Dasync.ExecutionEngine.Fx450.csproj
  26. +42 −5 Engine/ExecutionEngine/Proxy/ProxyMethodExecutor.cs
  27. +0 −74 Engine/ExecutionEngine/Proxy/RoutineImmediateExecutor.cs
  28. +20 −21 Engine/ExecutionEngine/Transitions/TransitionRunner.cs
  29. +1 −0 Examples/FeatureShowdown/DasyncFeatures.csproj
  30. +1 −0 Examples/FeatureShowdown/Program.cs
  31. +1 −1 Fabric/Bootstrap/Bootstrapper.cs
  32. +4 −0 Fabric/Bootstrap/Dasync.Bootstrap.Fx450.csproj
  33. +1 −0 Fabric/Bootstrap/Dasync.Bootstrap.csproj
  34. +1 −1 Fabric/Fabric.FileBased/DI.cs
  35. +4 −0 Fabric/Fabric.FileBased/Dasync.Fabric.FileBased.Fx450.csproj
  36. +1 −0 Fabric/Fabric.FileBased/Dasync.Fabric.FileBased.csproj
  37. +3 −6 Fabric/Fabric.FileBased/FileBasedFabric.cs
  38. +1 −2 Fabric/Fabric.FileBased/FileBasedFabricConnector.cs
  39. +1 −1 Fabric/Fabric.FileBased/FileBasedFabricConnectorFactory.cs
  40. +1 −1 Fabric/Fabric.FileBased/RoutineDataEnvelope.cs
  41. +3 −2 Fabric/Fabric.FileBased/TransitionCarrier.cs
  42. +1 −1 Fabric/Fabric.InMemory/DI.cs
  43. +4 −0 Fabric/Fabric.InMemory/Dasync.Fabric.InMemory.Fx450.csproj
  44. +1 −0 Fabric/Fabric.InMemory/Dasync.Fabric.InMemory.csproj
  45. +3 −4 Fabric/Fabric.InMemory/InMemoryFabric.cs
  46. +1 −1 Fabric/Fabric.InMemory/InMemoryFabricConnector.cs
  47. +1 −1 Fabric/Fabric.InMemory/InMemoryFabricConnectorFactory.cs
  48. +3 −2 Fabric/Fabric.InMemory/TransitionCarrier.cs
  49. +1 −1 {Engine/EETypes/Fabric → Fabric/Sample.Base}/ActiveRoutineInfo.cs
  50. +8 −0 Fabric/Sample.Base/AssemblyInfo.cs
  51. +1 −2 {Engine/ExecutionEngine/Fabric → Fabric/Sample.Base}/CurrentFabricHolder.cs
  52. +18 −0 Fabric/Sample.Base/DI.cs
  53. +71 −0 Fabric/Sample.Base/Dasync.Fabric.Sample.Base.Fx450.csproj
  54. +32 −0 Fabric/Sample.Base/Dasync.Fabric.Sample.Base.csproj
  55. +1 −2 {Engine/ExecutionEngine/Fabric → Fabric/Sample.Base}/FabricConnectorFactorySelector.cs
  56. +1 −2 {Engine/ExecutionEngine/Fabric → Fabric/Sample.Base}/FabricConnectorSelector.cs
  57. +1 −1 {Engine/EETypes/Fabric → Fabric/Sample.Base}/ICurrentFabric.cs
  58. +2 −1 {Engine/EETypes/Fabric → Fabric/Sample.Base}/IFabric.cs
  59. +1 −1 {Engine/EETypes/Fabric → Fabric/Sample.Base}/IFabricConnector.cs
  60. +3 −1 {Engine/EETypes/Fabric → Fabric/Sample.Base}/IFabricConnectorFactory.cs
  61. +1 −1 {Engine/EETypes/Fabric → Fabric/Sample.Base}/IFabricConnectorFactorySelector.cs
  62. +3 −1 {Engine/EETypes/Fabric → Fabric/Sample.Base}/IFabricConnectorSelector.cs
  63. +1 −1 {Engine/EETypes/Fabric → Fabric/Sample.Base}/IRoutinePollInterval.cs
  64. +3 −2 Engine/EETypes/Transitions/ITransitionCarrier.cs → Fabric/Sample.Base/ITransitionStateSaver.cs
  65. +82 −0 Fabric/Sample.Base/RoutineCompletionNotifier.cs
  66. +1 −1 {Engine/EETypes/Transitions → Fabric/Sample.Base}/RoutineStatus.cs
  67. +11 −14 {Engine/ExecutionEngine/Transitions → Fabric/Sample.Base}/TransitionCommitter.cs
@@ -1,4 +1,5 @@
.vs/
bin/
obj/
.user
packages/
*.user
@@ -6,9 +6,8 @@
using Dasync.CloudEvents;
using Dasync.EETypes;
using Dasync.EETypes.Descriptors;
using Dasync.EETypes.Fabric;
using Dasync.EETypes.Intents;
using Dasync.EETypes.Transitions;
using Dasync.Fabric.Sample.Base;
using Dasync.Serialization;
using Microsoft.WindowsAzure.Storage.Queue;
using Newtonsoft.Json;
@@ -1,7 +1,7 @@
using System;
using Dasync.AzureStorage;
using Dasync.EETypes;
using Dasync.EETypes.Fabric;
using Dasync.Fabric.Sample.Base;
using Dasync.Serialization;

namespace Dasync.FabricConnector.AzureStorage
@@ -1,6 +1,6 @@
using System;
using System.Collections.Generic;
using Dasync.EETypes.Fabric;
using Dasync.Fabric.Sample.Base;

namespace Dasync.FabricConnector.AzureStorage
{
@@ -67,6 +67,10 @@
<Project>{e10b9109-b721-492e-b32d-048bc8f147c6}</Project>
<Name>Dasync.EETypes.Fx450</Name>
</ProjectReference>
<ProjectReference Include="..\..\Fabric\Sample.Base\Dasync.Fabric.Sample.Base.Fx450.csproj">
<Project>{d131c1a5-3a82-4c91-b056-146d3af138d2}</Project>
<Name>Dasync.Fabric.Sample.Base.Fx450</Name>
</ProjectReference>
<ProjectReference Include="..\Storage\Dasync.AzureStorage.Fx450.csproj">
<Project>{e952af37-734c-458f-8202-8d639367b96e}</Project>
<Name>Dasync.AzureStorage.Fx450</Name>
@@ -24,7 +24,7 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="System.ValueTuple" Version="4.4.0" />
<PackageReference Include="System.ValueTuple" Version="4.5.0" />
<PackageReference Include="WindowsAzure.Storage" Version="9.0.0" />
</ItemGroup>

@@ -33,6 +33,7 @@
<ProjectReference Include="..\..\Data\Serialization\Dasync.Serialization.csproj" />
<ProjectReference Include="..\..\Data\ValueContainer\Dasync.ValueContainer.csproj" />
<ProjectReference Include="..\..\Engine\EETypes\Dasync.EETypes.csproj" />
<ProjectReference Include="..\..\Fabric\Sample.Base\Dasync.Fabric.Sample.Base.csproj" />
<ProjectReference Include="..\Storage\Dasync.AzureStorage.csproj" />
</ItemGroup>

@@ -11,11 +11,11 @@
using Dasync.CloudEvents;
using Dasync.EETypes;
using Dasync.EETypes.Descriptors;
using Dasync.EETypes.Fabric;
using Dasync.EETypes.Engine;
using Dasync.EETypes.Intents;
using Dasync.EETypes.Proxy;
using Dasync.EETypes.Transitions;
using Dasync.ExecutionEngine;
using Dasync.Fabric.Sample.Base;
using Dasync.FabricConnector.AzureStorage;
using Dasync.Proxy;
using Dasync.Serialization;
@@ -222,12 +222,11 @@ public Task TerminateAsync(CancellationToken ct)

var transitionCarrier = new AzureStorageTransitionCarrier(
eventEnvelope, _routinesTable, _servicesTable, _defaultSerializer);
var transitionData = transitionCarrier;

var concurrentExecutionDetected = false;
try
{
await _transitionRunner.RunAsync(transitionCarrier, transitionData, ct);
await _transitionRunner.RunAsync(transitionCarrier, ct);
}
catch (ConcurrentTransitionException)
{
@@ -7,15 +7,16 @@
using Dasync.EETypes;
using Dasync.EETypes.Descriptors;
using Dasync.EETypes.Intents;
using Dasync.EETypes.Transitions;
using Dasync.EETypes.Platform;
using Dasync.Fabric.Sample.Base;
using Dasync.FabricConnector.AzureStorage;
using Dasync.Serialization;
using Dasync.ValueContainer;
using Newtonsoft.Json;

namespace Dasync.Fabric.AzureFunctions
{
public class AzureStorageTransitionCarrier : ITransitionData, ITransitionCarrier
public class AzureStorageTransitionCarrier : ITransitionCarrier, ITransitionStateSaver
{
private static readonly List<string> RoutineRecordPropertiesToRequest =
new List<string>
@@ -185,12 +186,12 @@ public async Task SaveStateAsync(SaveStateIntent intent, CancellationToken ct)
routineRecord.Result = _serializer.SerializeToString(intent.RoutineResult);
routineRecord.Status = (int)RoutineStatus.Complete;
}
else if (intent.AwaitingRoutine != null)
else if (intent.AwaitedRoutine != null)
{
routineRecord.Status = (int)RoutineStatus.Awaiting;
routineRecord.AwaitService = intent.AwaitingRoutine.ServiceId?.ServiceName;
routineRecord.AwaitMethod = intent.AwaitingRoutine.MethodId?.MethodName;
routineRecord.AwaitIntentId = intent.AwaitingRoutine.Id;
routineRecord.AwaitService = intent.AwaitedRoutine.ServiceId?.ServiceName;
routineRecord.AwaitMethod = intent.AwaitedRoutine.MethodId?.MethodName;
routineRecord.AwaitIntentId = intent.AwaitedRoutine.Id;
}
else
{
@@ -1,8 +1,7 @@
using System;
using System.Collections.Generic;
using Dasync.EETypes.Fabric;
using Dasync.Fabric.Sample.Base;
using Dasync.FabricConnector.AzureStorage;
using Dasync.Ioc;
using Dasync.ServiceRegistry;

namespace Dasync.Fabric.AzureFunctions
@@ -120,6 +120,10 @@
<Project>{80cb1ca7-0acf-4c9f-850f-30990163ff4e}</Project>
<Name>Dasync.Bootstrap.Fx450</Name>
</ProjectReference>
<ProjectReference Include="..\..\..\Fabric\Sample.Base\Dasync.Fabric.Sample.Base.Fx450.csproj">
<Project>{d131c1a5-3a82-4c91-b056-146d3af138d2}</Project>
<Name>Dasync.Fabric.Sample.Base.Fx450</Name>
</ProjectReference>
<ProjectReference Include="..\..\..\Fabric\ServiceRegistry\Dasync.ServiceRegistry.Fx450.csproj">
<Project>{8797e703-e6d6-46b4-a4a5-ceaecac3fe03}</Project>
<Name>Dasync.ServiceRegistry.Fx450</Name>
@@ -6,7 +6,7 @@
using System.Threading;
using System.Threading.Tasks;
using Dasync.Bootstrap;
using Dasync.EETypes.Fabric;
using Dasync.Fabric.Sample.Base;
using Dasync.Ioc;
using Microsoft.Extensions.Logging;
using Newtonsoft.Json;
@@ -61,6 +61,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Dasync.CloudEvents.Fx450",
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Dasync.Fabric.FileBased.Fx450", "Fabric\Fabric.FileBased\Dasync.Fabric.FileBased.Fx450.csproj", "{7AC6C577-A929-40B3-812D-DE8FF7DD7AD6}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Dasync.Fabric.Sample.Base.Fx450", "Fabric\Sample.Base\Dasync.Fabric.Sample.Base.Fx450.csproj", "{D131C1A5-3A82-4C91-B056-146D3AF138D2}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
@@ -159,6 +161,10 @@ Global
{7AC6C577-A929-40B3-812D-DE8FF7DD7AD6}.Debug|Any CPU.Build.0 = Debug|Any CPU
{7AC6C577-A929-40B3-812D-DE8FF7DD7AD6}.Release|Any CPU.ActiveCfg = Release|Any CPU
{7AC6C577-A929-40B3-812D-DE8FF7DD7AD6}.Release|Any CPU.Build.0 = Release|Any CPU
{D131C1A5-3A82-4C91-B056-146D3AF138D2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{D131C1A5-3A82-4C91-B056-146D3AF138D2}.Debug|Any CPU.Build.0 = Debug|Any CPU
{D131C1A5-3A82-4C91-B056-146D3AF138D2}.Release|Any CPU.ActiveCfg = Release|Any CPU
{D131C1A5-3A82-4C91-B056-146D3AF138D2}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
@@ -188,6 +194,7 @@ Global
{AB32283E-0DF3-4806-BCE1-E3D9592A8A7F} = {DBA759D0-DC75-4883-A4C6-C08E479FDA28}
{057CC32B-4F80-4444-91A1-223488041FFF} = {284BE224-A303-4FA2-A520-D7671E5BD2BC}
{7AC6C577-A929-40B3-812D-DE8FF7DD7AD6} = {9143AAEA-5D04-4F44-9623-AE725CC71420}
{D131C1A5-3A82-4C91-B056-146D3AF138D2} = {9143AAEA-5D04-4F44-9623-AE725CC71420}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {9EC5AF2B-7D6F-4EB0-BCC3-6781DC488FAC}
@@ -67,6 +67,8 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DasyncFeatures", "Examples\
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Dasync.Ioc.Autofac", "IoC\IoC.Autofac\Dasync.Ioc.Autofac.csproj", "{CD303982-19D3-4322-B2F0-8048092E32E0}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Dasync.Fabric.Sample.Base", "Fabric\Sample.Base\Dasync.Fabric.Sample.Base.csproj", "{AA2EE6FF-DA89-442B-9213-5F2EA28F87DC}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
@@ -165,6 +167,10 @@ Global
{CD303982-19D3-4322-B2F0-8048092E32E0}.Debug|Any CPU.Build.0 = Debug|Any CPU
{CD303982-19D3-4322-B2F0-8048092E32E0}.Release|Any CPU.ActiveCfg = Release|Any CPU
{CD303982-19D3-4322-B2F0-8048092E32E0}.Release|Any CPU.Build.0 = Release|Any CPU
{AA2EE6FF-DA89-442B-9213-5F2EA28F87DC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{AA2EE6FF-DA89-442B-9213-5F2EA28F87DC}.Debug|Any CPU.Build.0 = Debug|Any CPU
{AA2EE6FF-DA89-442B-9213-5F2EA28F87DC}.Release|Any CPU.ActiveCfg = Release|Any CPU
{AA2EE6FF-DA89-442B-9213-5F2EA28F87DC}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
@@ -196,6 +202,7 @@ Global
{F4A664F5-8907-42D2-B05A-1AB1AF8B2BCA} = {0103B1F1-8F1D-4DB5-9EE5-CA5E8B970D10}
{1CFFE7F0-3321-4DC0-894D-8354738B081E} = {F4A664F5-8907-42D2-B05A-1AB1AF8B2BCA}
{CD303982-19D3-4322-B2F0-8048092E32E0} = {BDDDE05B-3CFC-4A50-8EFE-9C24A8ABBC4A}
{AA2EE6FF-DA89-442B-9213-5F2EA28F87DC} = {79D23AA5-2B44-49EF-B25B-EE784E5F68EE}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {F8B4417C-1BAD-421A-9164-89A427E53FA2}
@@ -16,14 +16,20 @@ public static class ContinuationWrapperAccessor

private static readonly FieldInfo _fi_m_continuation =
ContinuationWrapperType.GetField("m_continuation",
BindingFlags.Instance | BindingFlags.NonPublic) ??
ContinuationWrapperType.GetField("_continuation",
BindingFlags.Instance | BindingFlags.NonPublic);

private static readonly FieldInfo _fi_m_invokeAction =
ContinuationWrapperType.GetField("m_invokeAction",
BindingFlags.Instance | BindingFlags.NonPublic) ??
ContinuationWrapperType.GetField("_invokeAction",
BindingFlags.Instance | BindingFlags.NonPublic);

private static readonly FieldInfo _fi_m_innerTask =
ContinuationWrapperType.GetField("m_innerTask",
BindingFlags.Instance | BindingFlags.NonPublic) ??
ContinuationWrapperType.GetField("_innerTask",
BindingFlags.Instance | BindingFlags.NonPublic);

public static Action GetContinuation(object continuationWrapper)
@@ -46,10 +46,6 @@
<Compile Include="Descriptors\TransitionDescriptor.cs" />
<Compile Include="Descriptors\TransitionType.cs" />
<Compile Include="Descriptors\RoutineResultDescriptor.cs" />
<Compile Include="Fabric\ICurrentFabric.cs" />
<Compile Include="Fabric\IFabric.cs" />
<Compile Include="Fabric\IFabricConnectorFactory.cs" />
<Compile Include="Fabric\IFabricConnectorFactorySelector.cs" />
<Compile Include="Intents\ContinueRoutineIntent.cs" />
<Compile Include="Intents\CreateServiceInstanceIntent.cs" />
<Compile Include="Intents\ExecuteRoutineIntent.cs" />
@@ -59,19 +55,15 @@
<Compile Include="IRoutineMethodIdProvider.cs" />
<Compile Include="Intents\ScheduledActions.cs" />
<Compile Include="Descriptors\ServiceDescriptor.cs" />
<Compile Include="Fabric\ActiveRoutineInfo.cs" />
<Compile Include="Fabric\IFabricConnector.cs" />
<Compile Include="Fabric\IFabricConnectorSelector.cs" />
<Compile Include="Fabric\IRoutinePollInterval.cs" />
<Compile Include="Platform\IRoutineCompletionNotifier.cs" />
<Compile Include="RoutineMethodId.cs" />
<Compile Include="Transitions\ITransitionCarrier.cs" />
<Compile Include="Transitions\ITransitionData.cs" />
<Compile Include="Platform\ITransitionCarrier.cs" />
<Compile Include="Platform\ITransitionCommitter.cs" />
<Compile Include="Proxy\ProxyTaskState.cs" />
<Compile Include="Proxy\IServiceProxyBuilder.cs" />
<Compile Include="ServiceId.cs" />
<Compile Include="Proxy\ServiceProxyContext.cs" />
<Compile Include="Transitions\ITransitionRunner.cs" />
<Compile Include="Transitions\RoutineStatus.cs" />
<Compile Include="Engine\ITransitionRunner.cs" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\Data\ValueContainer\Dasync.ValueContainer.Fx450.csproj">
@@ -46,10 +46,7 @@
<Compile Include="Descriptors\TransitionDescriptor.cs" />
<Compile Include="Descriptors\TransitionType.cs" />
<Compile Include="Descriptors\RoutineResultDescriptor.cs" />
<Compile Include="Fabric\ICurrentFabric.cs" />
<Compile Include="Fabric\IFabric.cs" />
<Compile Include="Fabric\IFabricConnectorFactory.cs" />
<Compile Include="Fabric\IFabricConnectorFactorySelector.cs" />
<Compile Include="Engine\ITransitionRunner.cs" />
<Compile Include="Intents\ContinueRoutineIntent.cs" />
<Compile Include="Intents\CreateServiceInstanceIntent.cs" />
<Compile Include="Intents\ExecuteRoutineIntent.cs" />
@@ -59,18 +56,14 @@
<Compile Include="IRoutineMethodIdProvider.cs" />
<Compile Include="Intents\ScheduledActions.cs" />
<Compile Include="Descriptors\ServiceDescriptor.cs" />
<Compile Include="Fabric\ActiveRoutineInfo.cs" />
<Compile Include="Fabric\IFabricConnector.cs" />
<Compile Include="Fabric\IFabricConnectorSelector.cs" />
<Compile Include="Fabric\IRoutinePollInterval.cs" />
<Compile Include="Platform\IRoutineCompletionNotifier.cs" />
<Compile Include="Platform\ITransitionCarrier.cs" />
<Compile Include="Platform\ITransitionCommitter.cs" />
<Compile Include="RoutineMethodId.cs" />
<Compile Include="Transitions\ITransitionCarrier.cs" />
<Compile Include="Transitions\ITransitionData.cs" />
<Compile Include="Proxy\ProxyTaskState.cs" />
<Compile Include="Proxy\IServiceProxyBuilder.cs" />
<Compile Include="ServiceId.cs" />
<Compile Include="Proxy\ServiceProxyContext.cs" />
<Compile Include="Transitions\ITransitionRunner.cs" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\Data\ValueContainer\Dasync.ValueContainer.Fx450.csproj">
@@ -1,13 +1,13 @@
using System.Threading;
using System.Threading.Tasks;
using Dasync.EETypes.Platform;

namespace Dasync.EETypes.Transitions
namespace Dasync.EETypes.Engine
{
public interface ITransitionRunner
{
Task RunAsync(
ITransitionCarrier transitionCarrier,
ITransitionData transitionData,
CancellationToken ct);
}
}
@@ -24,5 +24,10 @@ public class ExecuteRoutineIntent
/// NULL when is called outside of the transitioning context.
/// </summary>
public CallerDescriptor Caller;

/// <summary>
/// A hint to notify current process on routine completion (synchronous call).
/// </summary>
public bool NotifyOnCompletion;
}
}
@@ -7,6 +7,7 @@ public sealed class SaveStateIntent
{
public ServiceId ServiceId;

#warning TODO: remove state of a service? Replace with a domain entity?
public IValueContainer ServiceState;

public RoutineDescriptor Routine;
@@ -19,6 +20,6 @@ public sealed class SaveStateIntent
/// If not null, the save state is caused due to calling another
/// routine which must resume the current one upon completion.
/// </summary>
public ExecuteRoutineIntent AwaitingRoutine;
public ExecuteRoutineIntent AwaitedRoutine;
}
}
@@ -1,6 +1,5 @@
using System;
using System.Collections.Generic;
using Dasync.EETypes.Descriptors;

namespace Dasync.EETypes.Intents
{
@@ -20,6 +19,7 @@ public sealed class ScheduledActions
/// <summary>
/// Save the state of the current routine if it's a state machine.
/// </summary>
#warning SaveRoutineState is just a flag indicating that SaveStateIntent must be initialized later
public bool SaveRoutineState;

public SaveStateIntent SaveStateIntent;
@@ -34,16 +34,17 @@ public sealed class ScheduledActions
/// <summary>
/// Describes all service instances that need to be created.
/// </summary>
#warning Need to finalize the factory pattern implementation first.
#warning Need to finalize the factory concept first.
public List<CreateServiceInstanceIntent> CreateServiceIntents;

/// <summary>
/// Delete an instance of current service because current routine
/// being invoked is <see cref="IDisposable.Dispose"/>.
/// The pre-requirment for this operation is the instance of the
/// The pre-requirement for this operation is the instance of the
/// service must be created with factory pattern in first place.
/// See related <see cref="CreateServiceIntents"/>.
/// </summary>
#warning Need to finalize the factory concept first.
public bool DeleteServiceInstance;
}
}
@@ -0,0 +1,10 @@
using System.Threading.Tasks;
using Dasync.EETypes.Descriptors;

namespace Dasync.EETypes.Platform
{
public interface IRoutineCompletionNotifier
{
void NotifyCompletion(long routineIntentId, TaskCompletionSource<TaskResult> completionSink);
}
}
Oops, something went wrong.

0 comments on commit b39acd3

Please sign in to comment.
You can’t perform that action at this time.