Skip to content
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

extend resolver trait to support task spawn and timeout #1626

Open
milyin opened this issue Dec 3, 2024 · 0 comments
Open

extend resolver trait to support task spawn and timeout #1626

milyin opened this issue Dec 3, 2024 · 0 comments
Labels
new feature Something new is needed

Comments

@milyin
Copy link
Contributor

milyin commented Dec 3, 2024

Describe the feature

On discussion on #1576 @Mallets pointed out, that it's not only the close operation may take some time and therefore should support "timeout" and "detach/backgound/spawn". you name it, functionality. The same problem appears for any operation, like e.g. "put".

So the solution proposed by @Mallets is:

  • make existing close api builder internal/unstable, implement it in zenoh-c under "internal" feature
  • extend Resolvable trait with methods like wait_timeout() and spawn()
  • support this timeout/detaching functionality in C API
decare_subscriber().wait();
decare_subscriber().wait_timeout(to);

decare_subscriber().await;

let handle = decare_subscriber().spawn();
handle.wait();

handle.wait_timeout(to);

decare_subscriber().spawn().timeout(to).await;

This issue extends the #1610

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
new feature Something new is needed
Projects
Status: No status
Development

No branches or pull requests

1 participant