Skip to main content

run

Function run 

Source
pub async fn run(config: &Config) -> Result<()>
Expand description

Starts the server based on the given configuration.

If http_port is configured, both the gRPC server and HTTP Gateway are started concurrently. Otherwise, only the gRPC server is started.

The function blocks until a shutdown signal (Ctrl+C) is received. On shutdown it commits any pending index changes before exiting.

§Arguments

  • config - Server, index, and logging configuration.

§Returns

Ok(()) when the server shuts down cleanly.

§Errors

Returns an error if the address cannot be parsed, the gRPC server fails to start, or the HTTP gateway listener cannot bind.