pub struct ReloadableRuntimeHttpHost { /* private fields */ }Expand description
HTTP host whose stable listener dispatches through one atomic generation.
Implementations§
Source§impl ReloadableRuntimeHttpHost
impl ReloadableRuntimeHttpHost
Sourcepub fn new(
initial_generation: u64,
host: RuntimeHttpHost,
) -> Result<Self, RuntimeHttpReloadError>
pub fn new( initial_generation: u64, host: RuntimeHttpHost, ) -> Result<Self, RuntimeHttpReloadError>
Creates a reloadable host from an already composed initial host.
Sourcepub fn prepare(
&self,
generation: u64,
host: RuntimeHttpHost,
) -> Result<PreparedRuntimeHttpGeneration, RuntimeHttpReloadError>
pub fn prepare( &self, generation: u64, host: RuntimeHttpHost, ) -> Result<PreparedRuntimeHttpGeneration, RuntimeHttpReloadError>
Validates and owns a candidate without changing live routing.
Sourcepub fn router(&self) -> Router
pub fn router(&self) -> Router
Returns a router that always dispatches through the active generation.
Sourcepub fn run_until_shutdown(&self, shutdown: Arc<AtomicBool>) -> Result<()>
pub fn run_until_shutdown(&self, shutdown: Arc<AtomicBool>) -> Result<()>
Runs the stable listener until cooperative shutdown is requested.
Sourcepub fn run_on_listener_until_shutdown(
&self,
listener: TcpListener,
shutdown: Arc<AtomicBool>,
) -> Result<()>
pub fn run_on_listener_until_shutdown( &self, listener: TcpListener, shutdown: Arc<AtomicBool>, ) -> Result<()>
Runs on a listener that the composition root already bound and checked.
Sourcepub async fn reload(
&self,
prepared: PreparedRuntimeHttpGeneration,
policy: HttpReloadPolicy,
) -> Result<(), RuntimeHttpReloadError>
pub async fn reload( &self, prepared: PreparedRuntimeHttpGeneration, policy: HttpReloadPolicy, ) -> Result<(), RuntimeHttpReloadError>
Health-checks, atomically activates, and drains one prepared generation.
Sourcepub fn snapshot(&self) -> HttpReloadSnapshot
pub fn snapshot(&self) -> HttpReloadSnapshot
Returns the active generation and bounded operational counters.
Auto Trait Implementations§
impl !Freeze for ReloadableRuntimeHttpHost
impl !RefUnwindSafe for ReloadableRuntimeHttpHost
impl !UnwindSafe for ReloadableRuntimeHttpHost
impl Send for ReloadableRuntimeHttpHost
impl Sync for ReloadableRuntimeHttpHost
impl Unpin for ReloadableRuntimeHttpHost
impl UnsafeUnpin for ReloadableRuntimeHttpHost
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