smbecker commented on code in PR #207: URL: https://github.com/apache/pulsar-dotpulsar/pull/207#discussion_r1529526379
########## src/DotPulsar/Internal/ConsumerChannel.cs: ########## @@ -70,6 +70,29 @@ public sealed class ConsumerChannel<TMessage> : IConsumerChannel<TMessage> _firstFlow = true; } + public async ValueTask<bool> HasMessageAvailable(CancellationToken cancellationToken) + { + using (await _lock.Lock(cancellationToken).ConfigureAwait(false)) + { + if (HasMessageQueued()) + { + return true; + } + + if (_sendWhenZero == 0) Review Comment: I don't know how I feel about this implementation. The Java Client leverages a cached MessageId for the [last dequeued message](https://github.com/apache/pulsar/blob/master/pulsar-client/src/main/java/org/apache/pulsar/client/impl/ConsumerImpl.java#L2390) but that doesn't seem available here unless changes were made to `Receive`, which I was trying to avoid. Any thoughts on how to improve? -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: commits-unsubscr...@pulsar.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org