@temporalio/core-bridge 1.10.0 → 1.10.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@temporalio/core-bridge",
3
- "version": "1.10.0",
3
+ "version": "1.10.2",
4
4
  "description": "Temporal.io SDK Core<>Node bridge",
5
5
  "main": "index.js",
6
6
  "types": "lib/index.d.ts",
@@ -22,7 +22,7 @@
22
22
  "author": "Temporal Technologies Inc. <sdk@temporal.io>",
23
23
  "license": "MIT",
24
24
  "dependencies": {
25
- "@temporalio/common": "1.10.0",
25
+ "@temporalio/common": "1.10.2",
26
26
  "arg": "^5.0.2",
27
27
  "cargo-cp-artifact": "^0.1.8",
28
28
  "which": "^4.0.0"
@@ -52,5 +52,5 @@
52
52
  "publishConfig": {
53
53
  "access": "public"
54
54
  },
55
- "gitHead": "39d702af7ae5d7e33ee90651292aa77fa07d33ca"
55
+ "gitHead": "a44bdfa780c1247fe7ed82b4b73c7b1577ee94af"
56
56
  }
package/scripts/build.js CHANGED
@@ -55,6 +55,10 @@ const forceBuild = args['--force'];
55
55
  const buildRelease = args['--release'] || process.env.BUILD_CORE_RELEASE !== undefined;
56
56
 
57
57
  function compile(requestedTarget) {
58
+ if (!fs.existsSync('sdk-core/Cargo.toml')) {
59
+ throw new Error('Missing sdk-core/Cargo.toml. Did you forget to run `git submodule update --init --recursive`?');
60
+ }
61
+
58
62
  const target = requestedTarget ?? getPrebuiltTargetName();
59
63
  console.log('Compiling bridge', { target, buildRelease });
60
64
 
package/src/runtime.rs CHANGED
@@ -22,7 +22,7 @@ use tokio::sync::{
22
22
  };
23
23
  use tokio_stream::wrappers::ReceiverStream;
24
24
 
25
- pub type RawClient = RetryClient<ConfiguredClient<TemporalServiceClientWithMetrics>>;
25
+ pub type CoreClient = RetryClient<ConfiguredClient<TemporalServiceClientWithMetrics>>;
26
26
 
27
27
  #[derive(Clone)]
28
28
  pub struct EphemeralServer {
@@ -43,7 +43,7 @@ impl Finalize for RuntimeHandle {}
43
43
  #[derive(Clone)]
44
44
  pub struct Client {
45
45
  pub(crate) runtime: Arc<RuntimeHandle>,
46
- pub(crate) core_client: Arc<RawClient>,
46
+ pub(crate) core_client: Arc<CoreClient>,
47
47
  }
48
48
 
49
49
  pub type BoxedClient = JsBox<RefCell<Option<Client>>>;
@@ -65,7 +65,7 @@ pub enum RuntimeRequest {
65
65
  },
66
66
  /// A request to update a client's HTTP request headers
67
67
  UpdateClientHeaders {
68
- client: Arc<RawClient>,
68
+ client: Arc<CoreClient>,
69
69
  headers: HashMap<String, String>,
70
70
  /// Used to send the result back into JS
71
71
  callback: Root<JsFunction>,
@@ -75,7 +75,7 @@ pub enum RuntimeRequest {
75
75
  /// Worker configuration e.g. limits and task queue
76
76
  config: WorkerConfig,
77
77
  /// A client created with a [CreateClient] request
78
- client: Arc<RawClient>,
78
+ client: Arc<CoreClient>,
79
79
  /// Used to send the result back into JS
80
80
  callback: Root<JsFunction>,
81
81
  },
@@ -107,7 +107,7 @@ pub enum RuntimeRequest {
107
107
  callback: Root<JsFunction>,
108
108
  },
109
109
  UpdateClientApiKey {
110
- client: Arc<RawClient>,
110
+ client: Arc<CoreClient>,
111
111
  key: String,
112
112
  callback: Root<JsFunction>,
113
113
  },
@@ -168,7 +168,7 @@ pub fn start_bridge_loop(
168
168
  options,
169
169
  callback,
170
170
  } => {
171
- let mm = core_runtime.telemetry().get_metric_meter();
171
+ let mm = core_runtime.telemetry().get_temporal_metric_meter();
172
172
  core_runtime.tokio_handle().spawn(async move {
173
173
  match options
174
174
  .connect_no_namespace(mm)
@@ -248,7 +248,7 @@ pub fn start_bridge_loop(
248
248
  callback,
249
249
  } => {
250
250
  let client = (*client).clone();
251
- match init_worker(&core_runtime, config, client.into_inner()) {
251
+ match init_worker(&core_runtime, config, client) {
252
252
  Ok(worker) => {
253
253
  let (tx, rx) = unbounded_channel();
254
254
  core_runtime.tokio_handle().spawn(start_worker_loop(