1- using System ;
2- using System . Collections . Generic ;
1+ using System . Collections . Generic ;
32using System . Threading . Tasks ;
43using Cleipnir . ResilientFunctions . CoreRuntime ;
54using Cleipnir . ResilientFunctions . CoreRuntime . Invocation ;
65using Cleipnir . ResilientFunctions . CoreRuntime . Serialization ;
6+ using Cleipnir . ResilientFunctions . CoreRuntime . Watchdogs ;
77using Cleipnir . ResilientFunctions . Domain ;
88using Cleipnir . ResilientFunctions . Storage ;
99
@@ -15,31 +15,31 @@ public class MessageWriters
1515 private readonly IFunctionStore _functionStore ;
1616 private readonly ISerializer _serializer ;
1717 private readonly ReplicaId _publisherReplica ;
18- private readonly Action ? _notifyDelivery ;
18+ private readonly MessageWatchdog ? _messageWatchdog ;
1919
20- public MessageWriters (
20+ internal MessageWriters (
2121 StoredType storedType ,
2222 IFunctionStore functionStore ,
2323 ISerializer serializer ,
2424 ReplicaId publisherReplica ,
25- Action ? notifyDelivery = null )
25+ MessageWatchdog ? messageWatchdog = null )
2626 {
2727 _storedType = storedType ;
2828 _functionStore = functionStore ;
2929 _serializer = serializer ;
3030 _publisherReplica = publisherReplica ;
31- _notifyDelivery = notifyDelivery ;
31+ _messageWatchdog = messageWatchdog ;
3232 }
3333
3434 public MessageWriter For ( FlowInstance instance )
3535 {
3636 var storedId = StoredId . Create ( _storedType , instance . Value ) ;
37- return new MessageWriter ( storedId , _functionStore . MessageStore , _serializer , _publisherReplica , _notifyDelivery ) ;
37+ return new MessageWriter ( storedId , _functionStore . MessageStore , _serializer , _publisherReplica , _messageWatchdog ) ;
3838 }
3939
4040 internal MessageWriter For ( StoredId storedId )
4141 {
42- return new MessageWriter ( storedId , _functionStore . MessageStore , _serializer , _publisherReplica , _notifyDelivery ) ;
42+ return new MessageWriter ( storedId , _functionStore . MessageStore , _serializer , _publisherReplica , _messageWatchdog ) ;
4343 }
4444
4545 public async Task AppendMessages ( IReadOnlyList < BatchedMessage > messages )
@@ -57,6 +57,6 @@ public async Task AppendMessages(IReadOnlyList<BatchedMessage> messages)
5757 await _functionStore . MessageStore . AppendMessages ( storedIdAndMessages ) ;
5858
5959 // Wake the MessageWatchdog so the appended messages are delivered now rather than on the next poll.
60- _notifyDelivery ? . Invoke ( ) ;
60+ _messageWatchdog ? . Notify ( ) ;
6161 }
6262}
0 commit comments