multithreadingrustiron

How to enable the threading feature in the Iron framework?


Does the Iron framework support multithreaded mode? How do I enable & configure it?


Solution

  • It is enabled by default.

    The primary structure in Iron is Iron, you can start the server using either the http or listen_with methods.

    For http:

    Defaults to a threadpool of size 8 * num_cpus.

    For listen_with: the signature takes a threads usize argument:

    Kick off the server process with X threads.

    Where I suppose X stands for the number of threads passed as argument.