Skip to content

Commit

Permalink
refactor: push resumeAt defaults to subscription wrapper constructor
Browse files Browse the repository at this point in the history
  • Loading branch information
malandis committed Nov 12, 2024
1 parent 1ba706a commit f34b24a
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/Momento.Sdk/Internal/ScsTopicClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ private async Task<TopicSubscribeResponse> SendSubscribe(string cacheName, strin
{
_logger.LogTraceExecutingTopicRequest(RequestTypeTopicSubscribe, cacheName, topicName);
subscriptionWrapper = new SubscriptionWrapper(grpcManager, cacheName, topicName,
resumeAtTopicSequenceNumber ?? 0, resumeAtTopicSequencePage ?? 0, _exceptionMapper, _logger);
resumeAtTopicSequenceNumber, resumeAtTopicSequencePage, _exceptionMapper, _logger);
await subscriptionWrapper.Subscribe();
}
catch (Exception e)
Expand Down Expand Up @@ -153,14 +153,14 @@ private class SubscriptionWrapper : IDisposable
private bool _subscribed;

public SubscriptionWrapper(TopicGrpcManager grpcManager, string cacheName,
string topicName, ulong resumeAtTopicSequenceNumber, ulong resumeAtTopicSequencePage,
string topicName, ulong? resumeAtTopicSequenceNumber, ulong? resumeAtTopicSequencePage,
CacheExceptionMapper exceptionMapper, ILogger logger)
{
_grpcManager = grpcManager;
_cacheName = cacheName;
_topicName = topicName;
_lastSequenceNumber = resumeAtTopicSequenceNumber;
_lastSequencePage = resumeAtTopicSequencePage;
_lastSequenceNumber = resumeAtTopicSequenceNumber ?? 0;
_lastSequencePage = resumeAtTopicSequencePage ?? 0;
_exceptionMapper = exceptionMapper;
_logger = logger;
}
Expand Down

0 comments on commit f34b24a

Please sign in to comment.