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

Re-export futures_lite in bevy_tasks #10670

Merged
merged 4 commits into from Nov 21, 2023
Merged

Re-export futures_lite in bevy_tasks #10670

merged 4 commits into from Nov 21, 2023

Conversation

BD103
Copy link
Member

@BD103 BD103 commented Nov 21, 2023

Objective

Solution

  • pub use futures_lite as future :)

Changelog

  • Made futures_lite available as future in the bevy_tasks module.

Migration Guide

  • Remove futures_lite from Cargo.toml.
[dependencies]
bevy = "0.12.0"
- futures-lite = "1.4.0"
  • Replace futures_lite imports with bevy::tasks::future.
- use futures_lite::poll_once;
+ use bevy::tasks::future::poll_once;

@BD103
Copy link
Member Author

BD103 commented Nov 21, 2023

Some other things I want to bring up:

  • The original issue suggests removing block_on from bevy_tasks. Right now, block_on can either be from futures_lite or async_io. Should I leave it how it is, or do you have any other suggestions?

#[cfg(feature = "async-io")]
pub use async_io::block_on;
#[cfg(not(feature = "async-io"))]
pub use futures_lite::future::block_on;

  • future is a really generic module name. Should I keep the re-export as futures_lite instead?

I also need to update the related examples, so please don't merge this yet. :)

@alice-i-cecile alice-i-cecile added C-Usability A simple quality-of-life change that makes Bevy easier to use A-Tasks Tools for parallel and async work labels Nov 21, 2023
@alice-i-cecile
Copy link
Member

The original issue suggests removing block_on from bevy_tasks. Right now, block_on can either be from futures_lite or async_io. Should I leave it how it is, or do you have any other suggestions?

Leave it as is IMO.

Copy link
Contributor

@Shatur Shatur left a comment

Choose a reason for hiding this comment

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

LGTM. But I would re-export as futures_lite.

examples/async_tasks/async_compute.rs Outdated Show resolved Hide resolved
@alice-i-cecile alice-i-cecile added the S-Ready-For-Final-Review This PR has been approved by the community. It's ready for a maintainer to consider merging it label Nov 21, 2023
auto-merge was automatically disabled November 21, 2023 16:11

Head branch was pushed to by a user without write access

@alice-i-cecile alice-i-cecile added this pull request to the merge queue Nov 21, 2023
Merged via the queue into bevyengine:main with commit 3578eec Nov 21, 2023
22 checks passed
@BD103 BD103 deleted the futures-lite branch November 21, 2023 17:29
@killercup killercup mentioned this pull request Nov 22, 2023
rdrpenguin04 pushed a commit to rdrpenguin04/bevy that referenced this pull request Jan 9, 2024
# Objective

- Fixes bevyengine#10664

## Solution

- `pub use futures_lite as future` :)

---

## Changelog

- Made `futures_lite` available as `future` in the `bevy_tasks` module.

## Migration Guide

- Remove `futures_lite` from `Cargo.toml`.

```diff
[dependencies]
bevy = "0.12.0"
- futures-lite = "1.4.0"
```

- Replace `futures_lite` imports with `bevy::tasks::future`.

```diff
- use futures_lite::poll_once;
+ use bevy::tasks::future::poll_once;
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-Tasks Tools for parallel and async work C-Usability A simple quality-of-life change that makes Bevy easier to use S-Ready-For-Final-Review This PR has been approved by the community. It's ready for a maintainer to consider merging it
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Re-export poll_once from Bevy
3 participants