Skip to content

Commit 717fe65

Browse files
authored
Remove Utilities record and Register subsystem (#135)
1 parent 41d31dd commit 717fe65

24 files changed

Lines changed: 10 additions & 1327 deletions

File tree

Core/Cleipnir.ResilientFunctions.Tests/InMemoryTests/UtilsTests/RegisterTests.cs

Lines changed: 0 additions & 61 deletions
This file was deleted.

Core/Cleipnir.ResilientFunctions.Tests/TestTemplates/UtilsTests/RegisterTests.cs

Lines changed: 0 additions & 158 deletions
This file was deleted.

Core/Cleipnir.ResilientFunctions.Tests/TestTemplates/WatchDogsTests/CrashableFunctionStore.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
using System;
22
using System.Collections.Generic;
33
using System.Threading.Tasks;
4-
using Cleipnir.ResilientFunctions.CoreRuntime.Invocation;
54
using Cleipnir.ResilientFunctions.Domain;
65
using Cleipnir.ResilientFunctions.Messaging;
76
using Cleipnir.ResilientFunctions.Storage;
@@ -22,7 +21,6 @@ public class CrashableFunctionStore : IFunctionStore
2221
private readonly CrashableEffectStore _crashableEffectStore;
2322
public IEffectsStore EffectsStore => _crashableEffectStore;
2423
public ICorrelationStore CorrelationStore => _crashed ? throw new TimeoutException() : _inner.CorrelationStore;
25-
public Utilities Utilities => _crashed ? throw new TimeoutException() : _inner.Utilities;
2624
public IReplicaStore ReplicaStore => _crashed ? throw new TimeoutException() : _inner.ReplicaStore;
2725

2826
public CrashableFunctionStore(IFunctionStore inner)

Core/Cleipnir.ResilientFunctions/CoreRuntime/Invocation/Invoker.cs

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,15 +20,13 @@ public class Invoker<TParam, TReturn>
2020

2121
private readonly InvocationHelper<TParam, TReturn> _invocationHelper;
2222
private readonly UnhandledExceptionHandler _unhandledExceptionHandler;
23-
private readonly Utilities _utilities;
2423
private readonly FlowsManager _flowsManager;
2524

2625
internal Invoker(
2726
FlowType flowType, StoredType storedType,
2827
Func<TParam, Workflow, Task<Result<TReturn>>> inner,
2928
InvocationHelper<TParam, TReturn> invocationHelper,
3029
UnhandledExceptionHandler unhandledExceptionHandler,
31-
Utilities utilities,
3230
ReplicaId replicaId,
3331
FlowsManager flowsManager
3432
)
@@ -39,7 +37,6 @@ FlowsManager flowsManager
3937
_inner = inner;
4038
_invocationHelper = invocationHelper;
4139
_unhandledExceptionHandler = unhandledExceptionHandler;
42-
_utilities = utilities;
4340
_flowsManager = flowsManager;
4441
}
4542

@@ -289,7 +286,7 @@ await _invocationHelper.PersistFunctionInStore(
289286
var queueManager = _invocationHelper.CreateQueueManager(flowId, storedId, effect, flowState, flowTimeouts, _unhandledExceptionHandler);
290287
disposables.Add(queueManager);
291288
var messageWriter = _invocationHelper.CreateMessageWriter(storedId);
292-
var workflow = new Workflow(flowId, storedId, effect, _utilities, correlations, queueManager, _invocationHelper.UtcNow, messageWriter);
289+
var workflow = new Workflow(flowId, storedId, effect, correlations, queueManager, _invocationHelper.UtcNow, messageWriter);
293290

294291
return new PreparedInvocation(
295292
persisted,
@@ -346,7 +343,6 @@ private async Task<PreparedReInvocation> PrepareForReInvocation(StoredId storedI
346343
flowId,
347344
storedId,
348345
effect,
349-
_utilities,
350346
correlations,
351347
queueManager,
352348
_invocationHelper.UtcNow,

Core/Cleipnir.ResilientFunctions/CoreRuntime/Invocation/Utilities.cs

Lines changed: 0 additions & 10 deletions
This file was deleted.

Core/Cleipnir.ResilientFunctions/CoreRuntime/Invocation/Workflow.cs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,19 +13,17 @@ public class Workflow
1313
public FlowId FlowId { get; }
1414
internal StoredId StoredId { get; }
1515
public Effect Effect { get; }
16-
public Utilities Utilities { get; }
1716
public Correlations Correlations { get; }
1817

1918
private QueueManager _queueManager;
2019
private readonly UtcNow _utcNow;
2120
private MessageWriter MessageWriter { get; }
2221

2322

24-
public Workflow(FlowId flowId, StoredId storedId, Effect effect, Utilities utilities, Correlations correlations, QueueManager queueManager, UtcNow utcNow, MessageWriter messageWriter)
23+
public Workflow(FlowId flowId, StoredId storedId, Effect effect, Correlations correlations, QueueManager queueManager, UtcNow utcNow, MessageWriter messageWriter)
2524
{
2625
FlowId = flowId;
2726
StoredId = storedId;
28-
Utilities = utilities;
2927
Effect = effect;
3028
Correlations = correlations;
3129
_queueManager = queueManager;

Core/Cleipnir.ResilientFunctions/FunctionsRegistry.cs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,6 @@ public FuncRegistration<TParam, TReturn> RegisterFunc<TParam, TReturn>(
228228
inner,
229229
invocationHelper,
230230
settingsWithDefaults.UnhandledExceptionHandler,
231-
_functionStore.Utilities,
232231
ClusterInfo.ReplicaId,
233232
_flowsManager
234233
);
@@ -318,7 +317,6 @@ private ParamlessRegistration RegisterParamless(
318317
inner,
319318
invocationHelper,
320319
settingsWithDefaults.UnhandledExceptionHandler,
321-
_functionStore.Utilities,
322320
ClusterInfo.ReplicaId,
323321
_flowsManager
324322
);
@@ -408,7 +406,6 @@ public ActionRegistration<TParam> RegisterAction<TParam>(
408406
inner,
409407
invocationHelper,
410408
settingsWithDefaults.UnhandledExceptionHandler,
411-
_functionStore.Utilities,
412409
ClusterInfo.ReplicaId,
413410
_flowsManager
414411
);

Core/Cleipnir.ResilientFunctions/Storage/IFunctionStore.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
using System.Collections.Generic;
22
using System.Threading.Tasks;
3-
using Cleipnir.ResilientFunctions.CoreRuntime.Invocation;
43
using Cleipnir.ResilientFunctions.Domain;
54
using Cleipnir.ResilientFunctions.Messaging;
65
using Cleipnir.ResilientFunctions.Storage.Session;
@@ -13,7 +12,6 @@ public interface IFunctionStore
1312
public IMessageStore MessageStore { get; }
1413
public IEffectsStore EffectsStore { get; }
1514
public ICorrelationStore CorrelationStore { get; }
16-
public Utilities Utilities { get; }
1715
public IReplicaStore ReplicaStore { get; }
1816
public Task Initialize();
1917

Core/Cleipnir.ResilientFunctions/Storage/InMemoryFunctionStore.cs

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,10 @@
33
using System.Linq;
44
using System.Threading;
55
using System.Threading.Tasks;
6-
using Cleipnir.ResilientFunctions.CoreRuntime.Invocation;
76
using Cleipnir.ResilientFunctions.Domain;
87
using Cleipnir.ResilientFunctions.Helpers;
98
using Cleipnir.ResilientFunctions.Messaging;
109
using Cleipnir.ResilientFunctions.Storage.Session;
11-
using Cleipnir.ResilientFunctions.Utils;
12-
using Cleipnir.ResilientFunctions.Utils.Register;
1310

1411
namespace Cleipnir.ResilientFunctions.Storage;
1512

@@ -25,17 +22,10 @@ public class InMemoryFunctionStore : IFunctionStore, IMessageStore
2522
public IEffectsStore EffectsStore => _effectsStore;
2623
private readonly InMemoryCorrelationStore _correlationStore = new();
2724
public ICorrelationStore CorrelationStore => _correlationStore;
28-
public Utilities Utilities { get; }
2925
public IReplicaStore ReplicaStore { get; } = new InMemoryReplicaStore();
3026

3127
public Task Initialize() => Task.CompletedTask;
3228

33-
public InMemoryFunctionStore()
34-
{
35-
var underlyingRegister = new UnderlyingInMemoryRegister();
36-
Utilities = new Utilities(new Register(underlyingRegister));
37-
}
38-
3929
#region FunctionStore
4030

4131
public virtual Task<IStorageSession?> CreateFunction(

Core/Cleipnir.ResilientFunctions/Utils/IUnderlyingRegister.cs

Lines changed: 0 additions & 13 deletions
This file was deleted.

0 commit comments

Comments
 (0)