-
-
Notifications
You must be signed in to change notification settings - Fork 48
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
expose the connection state to consumer and producer interface #239 #240
Conversation
Thanks for the PR, it looks good! Can you please also add it to the Reader interface and implementation, just like in Java code |
producers | ||
|> Seq.map (fun producer -> producer.IsConnected) | ||
|> Seq.contains(false) | ||
|> not |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you can replace it with
Seq.forall _.IsConnected
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this syntax does not work but I changed it to forall
|> Seq.map (fun (KeyValue(_, (consumer, _))) -> consumer.IsConnected) | ||
|> Seq.contains(false) | ||
|> not |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you can replace it with
Seq.forall (fun (KeyValue(_, (consumer, _))) -> consumer.IsConnected)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks much better 😃
match connectionHandler.ConnectionState with | ||
| Ready _ -> true | ||
| _ -> false |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please ident |
back to be right under match
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
match connectionHandler.ConnectionState with | ||
| Ready _ -> true | ||
| _ -> false |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please ident |
back to be right under match
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
|
Merged! Do you want to do this for 3.0 branch as well? 2.x will not receive performance updates and refactoring in future |
https://www.nuget.org/packages/Pulsar.Client/2.15.0 - this was published |
* expose the connection state to consumer and producer interface #239 (#240) * expose the connection state to consumer and producer interface #239 * fix issues from code review and add reader interface #239 * 2.15.0 release --------- Co-authored-by: Vladimir Shchur <[email protected]>
Hi @Lanayx,
here is my attempt for exposing the
IsConnected
.For the
MultiTopicsConsumerImpl
and thePartitionedProducerImpl
I've assumed that it will be returntrue
just when all Topics are connected and ready.I've tested it localy it with the
MultiTopicsConsumerImpl
and the property switched es expected.please give me feedback if it fits to your expectation.
Thanks
Erik