MCPcopy Create free account
hub / github.com/NthTensor/Forte / new

Method new

src/scope.rs:623–637  ·  view source on GitHub ↗

Creates a new `ScopedFutureJob` in an `Arc`. The caller is expected to immediately call `into_job_ref` and queue it on a worker to be polled.

(
        scope: &Scope<'scope, 'env>,
        scheduler: S,
        future: Fut,
    )

Source from the content-addressed store, hash-verified

621const WOKEN: u32 = 1;
622
623/// This value is used for the state of future-jobs that have not been woken and
624/// are either executing, completed, or have been canceled due to a panic. They
625/// may switch to the WOKEN state at any time, but are not queued to the pool
626/// when this happens (they are instead queued when the future is done being
627/// polled, assuming it has not panicked or been completed).
628///
629/// When a job finished executing and has not been WOKEN, it switches back to
630/// the READY state.
631const LOCKED: u32 = 2;
632
633/// This is a job that polls a future each time it is executed. The 'scope and
634/// 'env lifetimes are the same as the ones from scope (see [`Scope`] for a
635/// detailed explanation).
636///
637/// This struct is designed to live within an `Arc<T>` and be fully
638/// reference-counted.
639///
640/// This type serves a dual purpose:

Callers

nothing calls this directly

Calls 2

ScopePtrClass · 0.85
add_referenceMethod · 0.80

Tested by

no test coverage detected