feat(app): observe canonical placement receipts
This commit is contained in:
parent
378ca95a67
commit
f05ed5c3cd
14 changed files with 545 additions and 31 deletions
|
|
@ -173,6 +173,28 @@ public sealed class RuntimePlacementProjectionSubscriptionTests
|
|||
Assert.False(subscription.HasAppliedReceiptAwaitingAcknowledgement);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void SubscribeWithoutDrainPublishesOnlyAfterExplicitRetry()
|
||||
{
|
||||
using var fixture = new Fixture();
|
||||
RuntimeSetPositionOutcome pending = fixture.Place(
|
||||
fixture.First,
|
||||
new Vector3(18.5f, 18f, 7f));
|
||||
var sink = new RecordingSink();
|
||||
|
||||
using var subscription = fixture.Subscribe(
|
||||
sink,
|
||||
retryPendingOnSubscribe: false);
|
||||
|
||||
Assert.Empty(sink.Applied);
|
||||
Assert.Equal(1, fixture.Lifetime.Placements.PendingCount);
|
||||
|
||||
Assert.True(subscription.RetryPending());
|
||||
|
||||
Assert.Equal(pending.Projection, Assert.Single(sink.Applied).Token);
|
||||
Assert.Equal(0, fixture.Lifetime.Placements.PendingCount);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void SyntheticWithdrawalUsesTheSameExactSinkAndAckPath()
|
||||
{
|
||||
|
|
@ -263,10 +285,12 @@ public sealed class RuntimePlacementProjectionSubscriptionTests
|
|||
internal RuntimeEntityRecord? Second { get; }
|
||||
|
||||
internal RuntimePlacementProjectionSubscription Subscribe(
|
||||
IRuntimePlacementProjectionSink sink) => new(
|
||||
IRuntimePlacementProjectionSink sink,
|
||||
bool retryPendingOnSubscribe = true) => new(
|
||||
Lifetime.Placements,
|
||||
() => _generation,
|
||||
sink);
|
||||
sink,
|
||||
retryPendingOnSubscribe);
|
||||
|
||||
internal RuntimeSetPositionOutcome Place(
|
||||
RuntimeEntityRecord record,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue