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

Should Moka work in WASM? #423

Open
rogusdev opened this issue May 22, 2024 · 2 comments
Open

Should Moka work in WASM? #423

rogusdev opened this issue May 22, 2024 · 2 comments
Assignees
Labels
question Further information is requested

Comments

@rogusdev
Copy link

rogusdev commented May 22, 2024

There is a js feature which enables uuid/js feature, to use a web safe random generator. However, it seems that Moka still uses time somewhere, because in the browser the app panics on time not implemented on this platform. I would love to be able to use Moka in a web app (rust wasm), but am not sure if this is a use case that is intended to be supported, and currently broken (or I am doing something wrong), or if this is simply not what Moka is meant for.

Thanks!

@tatsuya6502
Copy link
Member

tatsuya6502 commented May 23, 2024

Hi. Sorry for the confusion. Unfortunately, the js feature was half-done by #173 and I would not surprise to see it is broken. I think we should remove the feature in next release.

Currently, we have not decided whether to make Moka to support WASM platform or not. And we do not have enough resource to develop it now:

https://github.com/orgs/moka-rs/projects/1?pane=issue&itemId=49877487

Some people have asked if moka would support Wasm platform. Currently, mokas primary goal is to provide the best performance and convenient features for concurrent programing, and it conflicts with common requirements in Wasm platform.

To support Wasm, it looks like we will need to develop a complete different and very simple implementation. We will revisit this and evaluate options.

I put a list of other cache implementations (crates) in the linked issue comment above, and if you can use some of them, that would be great. But if you cannot use any of them, because e.g. missing some features you need, please let us know.

@tatsuya6502 tatsuya6502 added the question Further information is requested label May 23, 2024
@tatsuya6502 tatsuya6502 self-assigned this May 23, 2024
@rogusdev
Copy link
Author

Thanks. I had already started using minimoka unsync so I'm good there :)

I asked this question simply because of the confusion over the feature flag not actually doing what it seemed it should.

Sounds like removing it would make sense, and thanks.

And maybe also an explicit message about wasm support somewhere!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants