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

example run error for async code #246

Closed
tempbottle opened this issue Apr 22, 2021 · 1 comment
Closed

example run error for async code #246

tempbottle opened this issue Apr 22, 2021 · 1 comment
Assignees
Labels
documentation Improvements or additions to documentation

Comments

@tempbottle
Copy link

Problem description
enter the examples dir, and run:
cargo run --example event_write_and_read
then get some error:
Running ~/pravega-client-rust/target/debug/examples/event_write_and_read
thread 'main' panicked at 'Cannot start a runtime from within a runtime. This happens because a function (like block_on) attempted to block the current thread while the thread is being used to drive asynchronous tasks.'

Problem location
there are many async and block_on in the async main function.

Suggestions for an improvement
correct the async and block_on combine in sub-crate or example.

@tkaitchuck tkaitchuck added the documentation Improvements or additions to documentation label May 7, 2021
@Tristan1900
Copy link
Member

Thanks for the report!
The example should work now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

No branches or pull requests

3 participants