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

Draft : add an async implementation of RefCell #95

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

gwen-lg
Copy link

@gwen-lg gwen-lg commented Jan 14, 2025

This is a draft to get comment.

During my experience of implementing puffin server on only one thread with async management (https://github.com/gwen-lg/puffin/commits/async_client_connecting_local/),
I was confronted with the risk of problem with usage of await during borrow of RefCell, so I have search for an async version of RefCell, but not found, so I have tried to implement myself.
As I was in a single thread context (with LocalExecutor), use RwLock seems not the most adapted.

I have in progress test to use it here : gwen-lg/puffin@934209e

Are you interested to add a RefCell in async-lock ?
If yes, have you some remark on the work ? On how to transform the PoC into "ready to include" work ?

it's allow to share data between async tasks one one thread (with local
executor)
@notgull
Copy link
Member

notgull commented Jan 15, 2025

I think this type is already implemented as unsend::lock::RwLock.

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

Successfully merging this pull request may close these issues.

2 participants