smbecker commented on PR #207:
URL: https://github.com/apache/pulsar-dotpulsar/pull/207#issuecomment-2013672203

   > In regards to "bool HasReachedEndOfTopic();", this is a state and could be 
checked that way.
   
   It currently is not possible to check current state, which was the purpose 
of [this 
change](https://github.com/apache/pulsar-dotpulsar/pull/207/files#diff-dd82a6892bf52f24ca2167d247198fbd63b6126383a09abb28280636ab8303bbR66).
 Also, this allows a consistent method for checking that covers both readers 
and consumers, which seems to line up with the purpose of the `IReceive` 
interface. Should I move the changes to `IStateChanged` to a separate PR? 
Should I remove this method in favor of just allowing checking the current 
state?
   
   > In regards to "ValueTask HasMessageAvailable(CancellationToken 
cancellationToken = default);" I'm not sure why that is needed and why it is 
async? If you want to call "HasMessageAvailable" to make sure that Receive is 
not blocked, then that can not be guaranteed, because HasMessageAvailable might 
return true, but before you get to call Receive the Reader/Consumer can have 
lost the connection or faulted. Are that you really need something like this: 
bool TryReceive(out Message message)?
   
   I was actually looking for something more similar to `TryReceive` but saw 
`hasMessageAvailableAsync` in the Java Client. However, it isn't simply just 
"Is there any messages that are already downloaded?"; It is also answering the 
question of "Is there any messages that could be downloaded from the broker?". 
The Java Client actually makes a call to `GetLastMessageId` to determine if the 
server has any additional messages that could be downloaded. Should I add 
`TryReceive` that only attempts to receive from what has already been 
downloaded? Should I update the implementation to be more inline with the Java 
Client in using `GetLastMessageId`? 
   
   Please advise...
   
   


-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to