-
Hello, I was wondering if threads or even I don't know rust much, sorry. Thanks for this repository btw 🙏 |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
You can spawn threads or async coroutine, spawn thread: https://doc.rust-lang.org/std/thread/fn.spawn.html, spawn coroutine using tokio: https://docs.rs/tokio/1.9.0/tokio/fn.spawn.html. If you are using NTS mode, spawn threads or coroutine in module init function will be persistent, spawn threads or coroutine in request lifetime will be drop after request finished. You can reference to http server example: https://github.com/jmjoy/phper/tree/master/examples/http-server. |
Beta Was this translation helpful? Give feedback.
You can spawn threads or async coroutine, spawn thread: https://doc.rust-lang.org/std/thread/fn.spawn.html, spawn coroutine using tokio: https://docs.rs/tokio/1.9.0/tokio/fn.spawn.html.
If you are using NTS mode, spawn threads or coroutine in module init function will be persistent, spawn threads or coroutine in request lifetime will be drop after request finished.
You can reference to http server example: https://github.com/jmjoy/phper/tree/master/examples/http-server.