Skip to content

Commit 2b33733

Browse files
committed
make worker_registry aware of workflow/activity/nexus capability for workers, with tests
1 parent 850db67 commit 2b33733

File tree

4 files changed

+595
-43
lines changed

4 files changed

+595
-43
lines changed

crates/client/src/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ pub use temporalio_common::protos::temporal::api::{
3636
pub use tonic;
3737
pub use worker_registry::{
3838
ClientWorker, ClientWorkerSet, HeartbeatCallback, SharedNamespaceWorkerTrait, Slot,
39+
WorkerCapabilities,
3940
};
4041
pub use workflow_handle::{
4142
GetWorkflowResultOpts, WorkflowExecutionInfo, WorkflowExecutionResult, WorkflowHandle,

crates/client/src/raw.rs

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1598,7 +1598,7 @@ proxier! {
15981598
#[cfg(test)]
15991599
mod tests {
16001600
use super::*;
1601-
use crate::{ClientOptionsBuilder, RetryClient};
1601+
use crate::{ClientOptionsBuilder, RetryClient, WorkerCapabilities};
16021602
use std::collections::HashSet;
16031603
use temporalio_common::protos::temporal::api::{
16041604
operatorservice::v1::DeleteNamespaceRequest, workflowservice::v1::ListNamespacesRequest,
@@ -1865,6 +1865,13 @@ mod tests {
18651865
mock_provider
18661866
.expect_worker_instance_key()
18671867
.return_const(uuid);
1868+
mock_provider
1869+
.expect_worker_capabilities()
1870+
.return_const(WorkerCapabilities {
1871+
handles_workflows: true,
1872+
handles_activities: true,
1873+
handles_nexus: true,
1874+
});
18681875

18691876
let client_worker_set = Arc::new(ClientWorkerSet::new());
18701877
client_worker_set

0 commit comments

Comments
 (0)