appcore_control_plane/
lib.rs1#![deny(missing_docs)]
17
18use appcore_contracts::ServiceId;
19use appcore_core::{
20 ClusterId, CoreId, CoreIdentity, RuntimeOperationalMode, TenantId, TraceContext,
21};
22use appcore_distributed_contracts::control_plane::v1::{
23 EmptyResponse, ServiceLeaseRequest, CONTROL_HEARTBEAT_PATH, CONTROL_PEERS_PATH,
24 CONTROL_REGISTER_PATH, CONTROL_SERVICE_LEASE_PATH, CONTROL_SERVICE_LEASE_RELEASE_PATH,
25};
26pub use appcore_transport::CancellationToken;
27use serde::{Deserialize, Serialize};
28use std::collections::BTreeMap;
29use std::future::Future;
30use std::pin::Pin;
31use std::sync::{mpsc, Arc, Mutex};
32use std::task::{Context, Poll, Waker};
33use std::thread;
34use std::time::Duration;
35
36pub mod v1 {
38 pub use appcore_distributed_contracts::control_plane::v1::*;
39}
40
41pub use v1::{
42 ControlPlaneError, ControlPlaneFuture, ControlPlaneProvider, ControlPlaneResult, CorePresence,
43 CoreRegistration, DiscoveryProvider, HeartbeatRequest, HeartbeatResponse, LeadershipDecision,
44 PeerDirectory, PeerRecord, ServiceLeaderLease, ServiceLeadershipGuard,
45};
46
47const DEFAULT_MAX_HTTP_RESPONSE_BYTES: usize = 1_048_576;
48const MAX_HTTP_HEADER_BYTES: usize = 32_768;
49const MAX_CONTROL_PLANE_WORK_ITEMS: usize = 64;
50
51mod client;
52mod coordinator;
53mod file;
54mod leadership;
55mod memory;
56mod offline;
57mod transport;
58mod worker;
59
60pub use client::{
61 ControlPlaneHttpConfig, HttpControlPlaneClient, HttpControlPlaneRequest,
62 HttpControlPlaneResponse, HttpTransport, RetryPolicy,
63};
64pub use coordinator::{ControlPlaneCoordinator, HeartbeatPolicy};
65pub use file::FileControlPlane;
66pub use leadership::StaticServiceLeadershipGuard;
67pub use memory::InMemoryControlPlane;
68pub use offline::OfflineControlPlaneClient;
69pub use transport::{
70 require_secure_remote_endpoint, BearerHttpTransport, SecretString, StdHttpTransport,
71};
72
73#[cfg(test)]
74mod tests;