Skip to content

Commit e5385bb

Browse files
committed
Rename UpsertWithoutFlush to FlushlessUpsert and use it in QueueClient
1 parent a73deae commit e5385bb

5 files changed

Lines changed: 8 additions & 8 deletions

File tree

Core/Cleipnir.ResilientFunctions.Tests/InMemoryTests/RFunctionTests/EffectTests.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,6 @@ public override Task UtcNowEffectSunshineTest()
151151
=> UtcNowEffectSunshineTest(FunctionStoreFactory.Create());
152152

153153
[TestMethod]
154-
public override Task UpsertWithoutFlushIsNotStoredUntilFlushed()
155-
=> UpsertWithoutFlushIsNotStoredUntilFlushed(FunctionStoreFactory.Create());
154+
public override Task FlushlessUpsertIsNotStoredUntilFlushed()
155+
=> FlushlessUpsertIsNotStoredUntilFlushed(FunctionStoreFactory.Create());
156156
}

Core/Cleipnir.ResilientFunctions.Tests/TestTemplates/FunctionTests/EffectTests.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1495,8 +1495,8 @@ async Task (workflow) =>
14951495
syncedList[0].ShouldBe(syncedList[1]);
14961496
}
14971497

1498-
public abstract Task UpsertWithoutFlushIsNotStoredUntilFlushed();
1499-
public async Task UpsertWithoutFlushIsNotStoredUntilFlushed(Task<IFunctionStore> storeTask)
1498+
public abstract Task FlushlessUpsertIsNotStoredUntilFlushed();
1499+
public async Task FlushlessUpsertIsNotStoredUntilFlushed(Task<IFunctionStore> storeTask)
15001500
{
15011501
var store = await storeTask;
15021502
var storedId = TestStoredId.Create();
@@ -1522,7 +1522,7 @@ public async Task UpsertWithoutFlushIsNotStoredUntilFlushed(Task<IFunctionStore>
15221522
);
15231523

15241524
var effectId = new EffectId([1]);
1525-
effectResults.UpsertWithoutFlush(effectId, alias: null, 42);
1525+
effectResults.FlushlessUpsert(effectId, alias: null, 42);
15261526

15271527
// before flush nothing should be stored
15281528
var fetchedResults = await effectStore.GetEffectResults(storedId);

Core/Cleipnir.ResilientFunctions/Domain/Effect.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ internal async Task Upsert<T>(string alias, T value, bool flush = true)
6565
flush
6666
);
6767
internal Task Upsert<T>(EffectId effectId, T value, string? alias, bool flush) => effectResults.Upsert(effectId, alias, value, flush);
68-
internal void UpsertWithoutFlush<T>(EffectId effectId, T value, string? alias) => effectResults.UpsertWithoutFlush(effectId, alias, value);
68+
internal void FlushlessUpsert<T>(EffectId effectId, T value, string? alias) => effectResults.FlushlessUpsert(effectId, alias, value);
6969

7070
internal Task Upserts(IEnumerable<EffectResult> values, bool flush)
7171
=> effectResults.Upserts(values, flush);

Core/Cleipnir.ResilientFunctions/Domain/EffectResults.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ await FlushOrAddToPending(
152152
);
153153
}
154154

155-
internal void UpsertWithoutFlush<T>(EffectId effectId, string? alias, T value)
155+
internal void FlushlessUpsert<T>(EffectId effectId, string? alias, T value)
156156
{
157157
var serializedValue = _serializer.Serialize(value!, typeof(T));
158158
var storedEffect = StoredEffect.CreateCompleted(effectId, serializedValue, alias);

Core/Cleipnir.ResilientFunctions/Queuing/QueueClient.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ public Task<Envelope> PullEnvelope<T>(Workflow workflow, EffectId parentId, Func
6767
);
6868

6969
if (result == null)
70-
await effect.Upsert<object?>(messageId, null, alias: null, flush: false);
70+
effect.FlushlessUpsert<object?>(messageId, null, alias: null);
7171

7272
return result;
7373
}

0 commit comments

Comments
 (0)