Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Session info #230

Merged
merged 4 commits into from
Sep 19, 2024
Merged

Session info #230

merged 4 commits into from
Sep 19, 2024

Conversation

DariusIMP
Copy link
Member

Adding SessionInfo class with the following functions:

  • fun id(): Result<ZenohID>
  • fun peers(): Result<List<ZenohID>>
  • fun routers(): Result<List<ZenohID>>

A Result.failure is returned in case of either:

  • JNI error (failure to create a kotlin instance for instance)
  • The session has been closed

Also, added the ZInfo example.

@DariusIMP DariusIMP requested a review from wyfo September 19, 2024 00:32
Copy link

PR missing one of the required labels: {'dependencies', 'breaking-change', 'internal', 'documentation', 'new feature', 'enhancement', 'bug'}

@DariusIMP DariusIMP added enhancement New feature or request release Part of the next release labels Sep 19, 2024
/**
* Class allowing to obtain the information of a [Session].
*/
class SessionInfo(private val session: Session) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why using Session instead of SessionInfo?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll let @wyfo and @DariusIMP decide if this comment is a blocker for this PR. Otherwise it LGTM.

/**
* Return the [ZenohID] of the current Zenoh [Session]
*/
fun id(): Result<ZenohID> {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
fun id(): Result<ZenohID> {
fun zid(): Result<ZenohID> {

/**
* Return the [ZenohID] of the zenoh peers the session is currently connected to.
*/
fun peersId(): Result<List<ZenohID>> {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
fun peersId(): Result<List<ZenohID>> {
fun peersZid(): Result<List<ZenohID>> {

/**
* Return the [ZenohID] of the zenoh routers the session is currently connected to.
*/
fun routersId(): Result<List<ZenohID>> {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
fun routersId(): Result<List<ZenohID>> {
fun routersZid(): Result<List<ZenohID>> {


package io.zenoh

import io.zenoh.protocol.ZenohID
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ZenohID should be renamed ZenohId to align

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Opened PR #233 for this, to be merged after this one.

@DariusIMP DariusIMP requested a review from wyfo September 19, 2024 14:20
@Mallets Mallets merged commit d443d9e into eclipse-zenoh:main Sep 19, 2024
7 checks passed
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
enhancement New feature or request release Part of the next release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants