shuttle
shuttle copied to clipboard
Introduce shuttle-ntex service
Description of change
Adding service for Ntex web framework. https://ntex.rs
Closes #1708
I added the tokio feature after getting a panic, but now I'm getting this when running the provided hello-world app:
# with patches applied
cargo r -p cargo-shuttle -- --wd examples/ntex/hello-world run
...
thread 'tokio-runtime-worker' panicked at /home/jonaro00/.cargo/registry/src/index.crates.io-6f17d22bba15001f/ntex-rt-0.4.12/src/lib.rs:192:9:
`spawn_local` called from outside of a `task::LocalSet`
Any idea how to solve it?
Will check it out:)
I added the tokio feature after getting a panic, but now I'm getting this when running the provided hello-world app:
# with patches applied cargo r -p cargo-shuttle -- --wd examples/ntex/hello-world run ... thread 'tokio-runtime-worker' panicked at /home/jonaro00/.cargo/registry/src/index.crates.io-6f17d22bba15001f/ntex-rt-0.4.12/src/lib.rs:192:9: `spawn_local` called from outside of a `task::LocalSet`Any idea how to solve it?
is this script generating an examples folder? 🤔 I am trying it locally on my macOS MBP, and it doesnt seem to do so. It only generates the config.toml inside .cargo/ with the proper substitutions.
I have found how to run the example and the same error is popping up for me too. I will probably open an issue on Ntex repo in order to have the authors' opinion!
I copied the actix example and modified it ;) Thanks for investigating!
So apparently after opening an issue on Ntex to ask about the error, it seems that Ntex is more loosely coupled with Tokio, than Actix, which means it builds its own runtime based on the feature used. So at the moment the web-server is about to start the runtime of Ntex has not been created yet. https://github.com/ntex-rs/ntex/blob/master/ntex-rt/src/lib.rs#L170
This would probably mean that Ntex would require changes to allow it access to the current Runtime of Shuttle or something along these lines.
I have tried to open a PR towards that direction, but I am not sure if I am able to accomplish it, so this will be blocked unitl there is a certain solution from Ntex maintainers 😞
@jonaro00 I have update to Ntex 0.4.13 which tries to "hook" on a Handle from Tokio if there is one, but apparently now I get build time errors due to not thread safe parts of Tokio being used. I unfortunately cannot debug this, even if I tried. Not so familiar with the language yet :/ Let me know if you have time to check it!