Skip to main content

start

Function start 

Source
pub fn start(config: Config) -> Result<(), Error>
Expand description

Start the daemon with the given config.

The daemon usually starts listening for commands around 100ms after this function is called on a low-end system, but some commands sent too early might fail if the music library isn’t loaded yet, the playback module is not initialized, or if the MPRIS server hasn’t started yet (if the MPRIS feature is enabled).

The initialization of the music library is by far the most time-consuming process ran when the daemon starts, and the time it takes vastly depends on the read speeds of the hard drive of the host machine and the size of the music library.

Note: This function will block. Launch it in a separate thread if you want to run the daemon in the background.

§Examples

let config = chilen_daemon::Config::try_default().unwrap();
chilen_daemon::start(config).unwrap();