pub struct HttpControlPlaneClient<T> { /* private fields */ }Expand description
Control-plane client that maps stable contracts onto an HTTP transport.
Implementations§
Source§impl<T> HttpControlPlaneClient<T>where
T: HttpTransport,
impl<T> HttpControlPlaneClient<T>where
T: HttpTransport,
Sourcepub fn new(config: ControlPlaneHttpConfig, transport: T) -> Self
pub fn new(config: ControlPlaneHttpConfig, transport: T) -> Self
Creates an HTTP client with a dedicated bounded worker queue.
Sourcepub fn with_cancellation_token(self, cancellation: CancellationToken) -> Self
pub fn with_cancellation_token(self, cancellation: CancellationToken) -> Self
Replaces the shared cancellation token used by requests and retries.
Sourcepub fn is_cancelled(&self) -> bool
pub fn is_cancelled(&self) -> bool
Reports whether this client has been cancelled.
Trait Implementations§
Source§impl<T> Clone for HttpControlPlaneClient<T>
impl<T> Clone for HttpControlPlaneClient<T>
Source§impl<T> ControlPlaneProvider for HttpControlPlaneClient<T>where
T: HttpTransport + 'static,
impl<T> ControlPlaneProvider for HttpControlPlaneClient<T>where
T: HttpTransport + 'static,
Source§fn register<'a>(
&'a self,
registration: CoreRegistration,
) -> ControlPlaneFuture<'a, CorePresence>
fn register<'a>( &'a self, registration: CoreRegistration, ) -> ControlPlaneFuture<'a, CorePresence>
Registers a running core.
Source§fn heartbeat<'a>(
&'a self,
request: HeartbeatRequest,
) -> ControlPlaneFuture<'a, HeartbeatResponse>
fn heartbeat<'a>( &'a self, request: HeartbeatRequest, ) -> ControlPlaneFuture<'a, HeartbeatResponse>
Reports liveness and current mode.
Source§fn 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.
Source§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 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.
Source§fn 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.
Source§fn 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.
Source§fn 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.
Source§fn 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.
Source§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 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.
Source§fn 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.
Auto Trait Implementations§
impl<T> Freeze for HttpControlPlaneClient<T>
impl<T> RefUnwindSafe for HttpControlPlaneClient<T>where
T: RefUnwindSafe,
impl<T> Send for HttpControlPlaneClient<T>
impl<T> Sync for HttpControlPlaneClient<T>
impl<T> Unpin for HttpControlPlaneClient<T>
impl<T> UnsafeUnpin for HttpControlPlaneClient<T>
impl<T> UnwindSafe for HttpControlPlaneClient<T>where
T: RefUnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> DiscoveryProvider for Twhere
T: ControlPlaneProvider + ?Sized,
impl<T> DiscoveryProvider for Twhere
T: ControlPlaneProvider + ?Sized,
Source§fn discover<'a>(
&'a self,
identity: &'a CoreIdentity,
) -> Pin<Box<dyn Future<Output = Result<PeerDirectory, ControlPlaneError>> + Send + 'a>>
fn discover<'a>( &'a self, identity: &'a CoreIdentity, ) -> Pin<Box<dyn Future<Output = Result<PeerDirectory, ControlPlaneError>> + Send + 'a>>
Discovers peers compatible with the supplied runtime identity.
Source§fn discover_traced<'a>(
&'a self,
identity: &'a CoreIdentity,
trace: Option<&'a TraceContext>,
) -> Pin<Box<dyn Future<Output = Result<PeerDirectory, ControlPlaneError>> + Send + 'a>>
fn discover_traced<'a>( &'a self, identity: &'a CoreIdentity, trace: Option<&'a TraceContext>, ) -> Pin<Box<dyn Future<Output = Result<PeerDirectory, ControlPlaneError>> + Send + 'a>>
Discovers peers while propagating trace context when supported.