Justin-Xiang commented on issue #3482:
URL:
https://github.com/apache/incubator-opendal/issues/3482#issuecomment-1798235280
Thank You! @Xuanwo
Hi, @messense , I'm Justin, I'm trying to replace Mutex with GILProtected.
take `fn close` for example, I can change state this way based on the
GILProtected document.
```rust
pub struct GILFile(Ars GILProtected‹GILFileState>>);
enum GILFileState{
Reader(ocore::Reader),
Writer(ocore::Writer),
Closed,
}
impl GILFile{
fn close<'p>(&'p mut self, py: Python<'p>) -> PyResult<()> {
Python::with_gil(|py| {
let mut state = self.0.get(py);
*state.borrow_mut() = &GILFileState::Closed;
});
Ok(())
}
}
```
But I don't know how to convert this to `future`, I can't put them in the
`async move` function body
Anyone else who knows how to deal with it can make a PR though I'm the
assignee.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]