Open shanelau opened 1 year ago
Hey,
Thanks for taking a look. I have seen this before and worked around it by droping the runtime in the api so I'm a little surprised to see it happening again.
Are you using the rust
crate from this project in your own flutter project? You may have more flexibility not calling the api from this project and calling the cashu-crab library directly. Though just a warning I'm in the middle of a refactor (see below).
I found using flutter and rust in the way I did in this project while interesting, quite difficult especially around async. Which is in part why I haven't worked on this in a bit, I am currently in the middle of refactoring the cashu-crab library to have native ffi bindings. This would enable the library to be used more easily in native apps as in theory at least I should be able to support kotlin, swift, and flutter bindings.
Thank you for working on this project, it has been very inspiring for my own project. However, I have encountered some issues.
If try to execute receive_token function twice, always get an error.
My code
Flutter ffi call
In the Flutter project, the process gets stuck and the cannot get lock. Any function call results in an error.
FfiException (FfiException(RESULT_ERROR, Failed to lock the runtime mutex: poisoned lock: another task failed inside, null))