struct Worker {
ctx: ExecutionContext,
api: AccessConnectorClient,
key_store: KeyStore<KeySlotIds>,
heartbeat_interval: Duration,
}Expand description
Authenticated connector state shared by the stages of the run loop.
Fields§
§ctx: ExecutionContext§api: AccessConnectorClient§key_store: KeyStore<KeySlotIds>§heartbeat_interval: DurationImplementations§
Source§impl Worker
impl Worker
Sourceasync fn start(
cfg: AccessConnectorConfig,
cancel: CancellationToken,
) -> Result<Self, RunExit>
async fn start( cfg: AccessConnectorConfig, cancel: CancellationToken, ) -> Result<Self, RunExit>
Authenticates and assembles the loop state, or returns the exit for a failed startup.
Sourceasync fn tick(&self, backoff: &mut Duration) -> ControlFlow<Stop>
async fn tick(&self, backoff: &mut Duration) -> ControlFlow<Stop>
One pass of the loop: poll, claim at most one job, and rotate it.
Sourceasync fn poll(&self, backoff: &mut Duration) -> ControlFlow<Stop, Vec<JobRef>>
async fn poll(&self, backoff: &mut Duration) -> ControlFlow<Stop, Vec<JobRef>>
Fetches claimable jobs, backing off on transient errors.
Sourceasync fn claim_one(&self, jobs: Vec<JobRef>) -> ControlFlow<Stop, WorkSnapshot>
async fn claim_one(&self, jobs: Vec<JobRef>) -> ControlFlow<Stop, WorkSnapshot>
Claims the first job that is still available; skips the tick when none is.
Sourceasync fn rotate(&self, snap: WorkSnapshot) -> ControlFlow<Stop>
async fn rotate(&self, snap: WorkSnapshot) -> ControlFlow<Stop>
Verifies and executes a claimed job; breaks only when the credential is refused.
Sourceasync fn handle_not_eligible(&self) -> Option<RunExit>
async fn handle_not_eligible(&self) -> Option<RunExit>
Forces a token refresh to tell a revoked credential from a connector that is not eligible.
None means the 404 did not survive the refresh (or a transient error hid it); keep
polling.
Auto Trait Implementations§
impl !RefUnwindSafe for Worker
impl !UnwindSafe for Worker
impl Freeze for Worker
impl Send for Worker
impl Sync for Worker
impl Unpin for Worker
impl UnsafeUnpin for Worker
Blanket Implementations§
§impl<T> AnySync for T
impl<T> AnySync for T
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
§impl<T> CompatExt for T
impl<T> CompatExt for T
§impl<T, UT> HandleAlloc<UT> for T
impl<T, UT> HandleAlloc<UT> for T
§fn new_handle(value: Arc<T>) -> Handle
fn new_handle(value: Arc<T>) -> Handle
Create a new handle for an Arc value Read more
§unsafe fn clone_handle(handle: Handle) -> Handle
unsafe fn clone_handle(handle: Handle) -> Handle
Clone a handle Read more
§unsafe fn consume_handle(handle: Handle) -> Arc<T> ⓘ
unsafe fn consume_handle(handle: Handle) -> Arc<T> ⓘ
Consume a handle, getting back the initial
Arc<> Read more§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more