pub struct Driver {
pub store: Store,
pub http: Client,
pub owner: String,
pub lease: i64,
pub registry: Arc<Registry>,
pub grpc: GrpcCaller,
pub workflows: Arc<WorkflowRegistry>,
}Fields§
§store: Store§http: Client§owner: String§lease: i64租约时长(秒)。持租约的实例崩了,这么久之后别的实例接手
registry: Arc<Registry>进程内分支注册表。嵌入式模式用,纯 HTTP 部署时是空表
grpc: GrpcCallergRPC 分支调用器(带 channel 缓存)
workflows: Arc<WorkflowRegistry>workflow 函数注册表。跟 registry 一样,纯 HTTP 部署时是空表
Implementations§
Source§impl Driver
impl Driver
pub fn new(store: Store, owner: String) -> Self
Sourcepub fn with_registry(self, r: Arc<Registry>) -> Self
pub fn with_registry(self, r: Arc<Registry>) -> Self
挂上进程内分支注册表 —— 嵌入式模式的入口
Sourcepub fn with_workflows(self, w: Arc<WorkflowRegistry>) -> Self
pub fn with_workflows(self, w: Arc<WorkflowRegistry>) -> Self
挂上 workflow 函数注册表
Sourcepub async fn run_forever(self, tick: Duration)
pub async fn run_forever(self, tick: Duration)
常驻循环:抢一个到期事务推一下,没活就睡
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for Driver
impl !UnwindSafe for Driver
impl Freeze for Driver
impl Send for Driver
impl Sync for Driver
impl Unpin for Driver
impl UnsafeUnpin for Driver
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> 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 moreSource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::Request