Skip to content

Use feature flag to enable wasm builds#159

Open
nothingismagick wants to merge 3 commits intoriker-rs:masterfrom
nothingismagick:master
Open

Use feature flag to enable wasm builds#159
nothingismagick wants to merge 3 commits intoriker-rs:masterfrom
nothingismagick:master

Conversation

@nothingismagick
Copy link
Copy Markdown
Contributor

Closes #151.

This just adds a feature flag (and relevant uuid feature) that allows devs to conditionally compile riker for wasm runtimes.

Signed-off-by: Daniel Thompson-Yvetot <denjell@mailscript.com>
Signed-off-by: Daniel Thompson-Yvetot <denjell@mailscript.com>
@nothingismagick
Copy link
Copy Markdown
Contributor Author

I didn't mention that I tested this both with build and test (on macos).

Signed-off-by: Daniel Thompson-Yvetot <denjell@mailscript.com>
@nothingismagick
Copy link
Copy Markdown
Contributor Author

This can get merged, its a non-breaking change.

@lukewestby
Copy link
Copy Markdown

@nothingismagick does this need to be made more general? futures::executor::ThreadPool isn't supported in WASM yet.

https://github.com/nothingismagick/riker/blob/master/src/system.rs#L269

@siriux
Copy link
Copy Markdown

siriux commented Feb 5, 2021

@lukewestby I'm working on an agnostic executor library to enable riker to use different executors, including WASM. That would be a first step into making riker wasm compatible.

#152

But it's not only the threadpool, it's also integrating with timers (also supported by the new library), testing with wasm-pack, using channels that work in WASM (it can be tricky sometimes) and I'm sure many more things.

@lukewestby
Copy link
Copy Markdown

Understood. Thank you!

@siriux
Copy link
Copy Markdown

siriux commented Feb 8, 2021

Just to let you know, I'm not sure anymore that riker can ever support WASM without major changes.
That's because WASM doesn't support catching panics, and riker heavily relies on this for its supervision model.

And even if major incompatible changes were introduced to fix that, there are still many more things to fix.

Sure, it could be done, but it's probably better to create a lighter actor library from scratch, with WASM and agnostic executors support baked in from the beginning. And leave riker for the server use case that was designed for.

@nothingismagick
Copy link
Copy Markdown
Contributor Author

WASM isn't just for the browser and riker isn't just for a server... Just saying

@siriux
Copy link
Copy Markdown

siriux commented Feb 8, 2021

Sure. Let's just say current riker design is not really WASM friendly. Anyone can apply it to their own use case ;-)

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Enable riker to build in wasm

4 participants