Skip to main content

Service

Trait Service 

Source
pub trait Service:
    Debug
    + Send
    + Sync {
    // Required method
    fn addresses(&self, port: &str) -> Vec<String>;

    // Provided method
    fn tcp_addresses(&self, port: &str) -> Vec<String> { ... }
}
Expand description

Describes a running service managed by an Orchestrator.

Required Methods§

Source

fn addresses(&self, port: &str) -> Vec<String>

Given the name of a port, returns the addresses for each of the service’s processes, in order.

Panics if port does not name a valid port.

Provided Methods§

Source

fn tcp_addresses(&self, port: &str) -> Vec<String>

Given the name of a port, returns TCP-accessible addresses for each of the service’s processes, in order.

This method is used when HTTP/TCP connectivity is needed (e.g., for proxying HTTP requests). For orchestrators that use Unix sockets internally (like the process orchestrator), this returns the TCP proxy addresses instead of the socket paths.

The default implementation returns the same as addresses(), which is appropriate for orchestrators that already use TCP addresses (like Kubernetes).

Panics if port does not name a valid port.

Implementors§