pub trait ControlPlaneProvider: Send + Sync {
// Required methods
fn register<'a>(
&'a self,
registration: CoreRegistration,
) -> ControlPlaneFuture<'a, CorePresence>;
fn heartbeat<'a>(
&'a self,
request: HeartbeatRequest,
) -> ControlPlaneFuture<'a, HeartbeatResponse>;
fn discover_peers<'a>(
&'a self,
identity: &'a CoreIdentity,
) -> ControlPlaneFuture<'a, PeerDirectory>;
fn acquire_or_renew_service_lease<'a>(
&'a self,
identity: &'a CoreIdentity,
service_id: &'a ServiceId,
ttl_ms: u64,
now_ms: u64,
) -> ControlPlaneFuture<'a, ServiceLeaderLease>;
fn release_service_lease<'a>(
&'a self,
lease: ServiceLeaderLease,
) -> ControlPlaneFuture<'a, ()>;
// Provided methods
fn register_traced<'a>(
&'a self,
registration: CoreRegistration,
_trace: Option<&'a TraceContext>,
) -> ControlPlaneFuture<'a, CorePresence> { ... }
fn heartbeat_traced<'a>(
&'a self,
request: HeartbeatRequest,
_trace: Option<&'a TraceContext>,
) -> ControlPlaneFuture<'a, HeartbeatResponse> { ... }
fn discover_peers_traced<'a>(
&'a self,
identity: &'a CoreIdentity,
_trace: Option<&'a TraceContext>,
) -> ControlPlaneFuture<'a, PeerDirectory> { ... }
fn acquire_or_renew_service_lease_traced<'a>(
&'a self,
identity: &'a CoreIdentity,
service_id: &'a ServiceId,
ttl_ms: u64,
now_ms: u64,
_trace: Option<&'a TraceContext>,
) -> ControlPlaneFuture<'a, ServiceLeaderLease> { ... }
fn release_service_lease_traced<'a>(
&'a self,
lease: ServiceLeaderLease,
_trace: Option<&'a TraceContext>,
) -> ControlPlaneFuture<'a, ()> { ... }
}Expand description
Provider contract for presence, discovery and leadership coordination.
Required Methods§
Sourcefn register<'a>(
&'a self,
registration: CoreRegistration,
) -> ControlPlaneFuture<'a, CorePresence>
fn register<'a>( &'a self, registration: CoreRegistration, ) -> ControlPlaneFuture<'a, CorePresence>
Registers a running core.
Sourcefn heartbeat<'a>(
&'a self,
request: HeartbeatRequest,
) -> ControlPlaneFuture<'a, HeartbeatResponse>
fn heartbeat<'a>( &'a self, request: HeartbeatRequest, ) -> ControlPlaneFuture<'a, HeartbeatResponse>
Reports liveness and current mode.
Sourcefn discover_peers<'a>(
&'a self,
identity: &'a CoreIdentity,
) -> ControlPlaneFuture<'a, PeerDirectory>
fn discover_peers<'a>( &'a self, identity: &'a CoreIdentity, ) -> ControlPlaneFuture<'a, PeerDirectory>
Discovers compatible peers.
Sourcefn acquire_or_renew_service_lease<'a>(
&'a self,
identity: &'a CoreIdentity,
service_id: &'a ServiceId,
ttl_ms: u64,
now_ms: u64,
) -> ControlPlaneFuture<'a, ServiceLeaderLease>
fn acquire_or_renew_service_lease<'a>( &'a self, identity: &'a CoreIdentity, service_id: &'a ServiceId, ttl_ms: u64, now_ms: u64, ) -> ControlPlaneFuture<'a, ServiceLeaderLease>
Acquires or renews leadership independently for one service.
Sourcefn release_service_lease<'a>(
&'a self,
lease: ServiceLeaderLease,
) -> ControlPlaneFuture<'a, ()>
fn release_service_lease<'a>( &'a self, lease: ServiceLeaderLease, ) -> ControlPlaneFuture<'a, ()>
Releases leadership for one service.
Provided Methods§
Sourcefn register_traced<'a>(
&'a self,
registration: CoreRegistration,
_trace: Option<&'a TraceContext>,
) -> ControlPlaneFuture<'a, CorePresence>
fn register_traced<'a>( &'a self, registration: CoreRegistration, _trace: Option<&'a TraceContext>, ) -> ControlPlaneFuture<'a, CorePresence>
Registers a core while propagating trace context when supported.
Sourcefn heartbeat_traced<'a>(
&'a self,
request: HeartbeatRequest,
_trace: Option<&'a TraceContext>,
) -> ControlPlaneFuture<'a, HeartbeatResponse>
fn heartbeat_traced<'a>( &'a self, request: HeartbeatRequest, _trace: Option<&'a TraceContext>, ) -> ControlPlaneFuture<'a, HeartbeatResponse>
Sends a heartbeat while propagating trace context when supported.
Sourcefn discover_peers_traced<'a>(
&'a self,
identity: &'a CoreIdentity,
_trace: Option<&'a TraceContext>,
) -> ControlPlaneFuture<'a, PeerDirectory>
fn discover_peers_traced<'a>( &'a self, identity: &'a CoreIdentity, _trace: Option<&'a TraceContext>, ) -> ControlPlaneFuture<'a, PeerDirectory>
Discovers peers while propagating trace context when supported.
Sourcefn acquire_or_renew_service_lease_traced<'a>(
&'a self,
identity: &'a CoreIdentity,
service_id: &'a ServiceId,
ttl_ms: u64,
now_ms: u64,
_trace: Option<&'a TraceContext>,
) -> ControlPlaneFuture<'a, ServiceLeaderLease>
fn acquire_or_renew_service_lease_traced<'a>( &'a self, identity: &'a CoreIdentity, service_id: &'a ServiceId, ttl_ms: u64, now_ms: u64, _trace: Option<&'a TraceContext>, ) -> ControlPlaneFuture<'a, ServiceLeaderLease>
Acquires a service lease while propagating trace context when supported.
Sourcefn release_service_lease_traced<'a>(
&'a self,
lease: ServiceLeaderLease,
_trace: Option<&'a TraceContext>,
) -> ControlPlaneFuture<'a, ()>
fn release_service_lease_traced<'a>( &'a self, lease: ServiceLeaderLease, _trace: Option<&'a TraceContext>, ) -> ControlPlaneFuture<'a, ()>
Releases a service lease while propagating trace context when supported.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".