@temporalio/core-bridge 1.5.2 → 1.7.0
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/Cargo.lock +304 -112
- package/lib/index.d.ts +8 -6
- package/lib/index.js.map +1 -1
- package/package.json +9 -4
- package/releases/aarch64-apple-darwin/index.node +0 -0
- package/releases/aarch64-unknown-linux-gnu/index.node +0 -0
- package/releases/x86_64-apple-darwin/index.node +0 -0
- package/releases/x86_64-pc-windows-msvc/index.node +0 -0
- package/releases/x86_64-unknown-linux-gnu/index.node +0 -0
- package/sdk-core/.buildkite/docker/Dockerfile +2 -2
- package/sdk-core/.buildkite/docker/docker-compose.yaml +1 -1
- package/sdk-core/.buildkite/pipeline.yml +2 -4
- package/sdk-core/.cargo/config.toml +5 -2
- package/sdk-core/.github/workflows/heavy.yml +29 -0
- package/sdk-core/Cargo.toml +1 -1
- package/sdk-core/README.md +20 -10
- package/sdk-core/client/src/lib.rs +215 -39
- package/sdk-core/client/src/metrics.rs +17 -8
- package/sdk-core/client/src/raw.rs +4 -4
- package/sdk-core/client/src/retry.rs +32 -20
- package/sdk-core/core/Cargo.toml +25 -12
- package/sdk-core/core/src/abstractions/take_cell.rs +28 -0
- package/sdk-core/core/src/abstractions.rs +204 -14
- package/sdk-core/core/src/core_tests/activity_tasks.rs +143 -50
- package/sdk-core/core/src/core_tests/child_workflows.rs +6 -5
- package/sdk-core/core/src/core_tests/determinism.rs +165 -2
- package/sdk-core/core/src/core_tests/local_activities.rs +431 -43
- package/sdk-core/core/src/core_tests/queries.rs +34 -16
- package/sdk-core/core/src/core_tests/workers.rs +8 -5
- package/sdk-core/core/src/core_tests/workflow_tasks.rs +588 -55
- package/sdk-core/core/src/ephemeral_server/mod.rs +113 -12
- package/sdk-core/core/src/internal_flags.rs +155 -0
- package/sdk-core/core/src/lib.rs +16 -9
- package/sdk-core/core/src/protosext/mod.rs +1 -1
- package/sdk-core/core/src/replay/mod.rs +16 -27
- package/sdk-core/core/src/telemetry/log_export.rs +1 -1
- package/sdk-core/core/src/telemetry/metrics.rs +69 -35
- package/sdk-core/core/src/telemetry/mod.rs +60 -21
- package/sdk-core/core/src/telemetry/prometheus_server.rs +19 -13
- package/sdk-core/core/src/test_help/mod.rs +73 -14
- package/sdk-core/core/src/worker/activities/activity_heartbeat_manager.rs +119 -160
- package/sdk-core/core/src/worker/activities/activity_task_poller_stream.rs +89 -0
- package/sdk-core/core/src/worker/activities/local_activities.rs +379 -129
- package/sdk-core/core/src/worker/activities.rs +350 -175
- package/sdk-core/core/src/worker/client/mocks.rs +22 -2
- package/sdk-core/core/src/worker/client.rs +18 -2
- package/sdk-core/core/src/worker/mod.rs +183 -64
- package/sdk-core/core/src/worker/workflow/bridge.rs +1 -3
- package/sdk-core/core/src/worker/workflow/driven_workflow.rs +3 -5
- package/sdk-core/core/src/worker/workflow/history_update.rs +916 -277
- package/sdk-core/core/src/worker/workflow/machines/activity_state_machine.rs +216 -183
- package/sdk-core/core/src/worker/workflow/machines/cancel_external_state_machine.rs +9 -12
- package/sdk-core/core/src/worker/workflow/machines/cancel_workflow_state_machine.rs +7 -9
- package/sdk-core/core/src/worker/workflow/machines/child_workflow_state_machine.rs +160 -87
- package/sdk-core/core/src/worker/workflow/machines/complete_workflow_state_machine.rs +13 -14
- package/sdk-core/core/src/worker/workflow/machines/continue_as_new_workflow_state_machine.rs +7 -9
- package/sdk-core/core/src/worker/workflow/machines/fail_workflow_state_machine.rs +14 -17
- package/sdk-core/core/src/worker/workflow/machines/local_activity_state_machine.rs +242 -110
- package/sdk-core/core/src/worker/workflow/machines/mod.rs +27 -19
- package/sdk-core/core/src/worker/workflow/machines/modify_workflow_properties_state_machine.rs +9 -11
- package/sdk-core/core/src/worker/workflow/machines/patch_state_machine.rs +321 -206
- package/sdk-core/core/src/worker/workflow/machines/signal_external_state_machine.rs +13 -18
- package/sdk-core/core/src/worker/workflow/machines/timer_state_machine.rs +20 -29
- package/sdk-core/core/src/worker/workflow/machines/transition_coverage.rs +2 -2
- package/sdk-core/core/src/worker/workflow/machines/upsert_search_attributes_state_machine.rs +257 -51
- package/sdk-core/core/src/worker/workflow/machines/workflow_machines/local_acts.rs +6 -17
- package/sdk-core/core/src/worker/workflow/machines/workflow_machines.rs +310 -150
- package/sdk-core/core/src/worker/workflow/machines/workflow_task_state_machine.rs +17 -20
- package/sdk-core/core/src/worker/workflow/managed_run/managed_wf_test.rs +31 -15
- package/sdk-core/core/src/worker/workflow/managed_run.rs +1052 -380
- package/sdk-core/core/src/worker/workflow/mod.rs +598 -390
- package/sdk-core/core/src/worker/workflow/run_cache.rs +40 -57
- package/sdk-core/core/src/worker/workflow/wft_extraction.rs +137 -0
- package/sdk-core/core/src/worker/workflow/wft_poller.rs +1 -4
- package/sdk-core/core/src/worker/workflow/workflow_stream/saved_wf_inputs.rs +117 -0
- package/sdk-core/core/src/worker/workflow/workflow_stream/tonic_status_serde.rs +24 -0
- package/sdk-core/core/src/worker/workflow/workflow_stream.rs +469 -718
- package/sdk-core/core-api/Cargo.toml +2 -1
- package/sdk-core/core-api/src/errors.rs +1 -34
- package/sdk-core/core-api/src/lib.rs +19 -9
- package/sdk-core/core-api/src/telemetry.rs +4 -6
- package/sdk-core/core-api/src/worker.rs +19 -1
- package/sdk-core/etc/deps.svg +115 -140
- package/sdk-core/etc/regen-depgraph.sh +5 -0
- package/sdk-core/fsm/rustfsm_procmacro/src/lib.rs +86 -61
- package/sdk-core/fsm/rustfsm_trait/src/lib.rs +29 -71
- package/sdk-core/histories/ends_empty_wft_complete.bin +0 -0
- package/sdk-core/histories/evict_while_la_running_no_interference-16_history.bin +0 -0
- package/sdk-core/histories/old_change_marker_format.bin +0 -0
- package/sdk-core/protos/api_upstream/.github/CODEOWNERS +2 -1
- package/sdk-core/protos/api_upstream/Makefile +6 -6
- package/sdk-core/protos/api_upstream/build/go.mod +7 -0
- package/sdk-core/protos/api_upstream/build/go.sum +5 -0
- package/sdk-core/protos/api_upstream/build/tools.go +29 -0
- package/sdk-core/protos/api_upstream/go.mod +6 -0
- package/sdk-core/protos/api_upstream/temporal/api/batch/v1/message.proto +9 -2
- package/sdk-core/protos/api_upstream/temporal/api/command/v1/message.proto +7 -26
- package/sdk-core/protos/api_upstream/temporal/api/common/v1/message.proto +13 -2
- package/sdk-core/protos/api_upstream/temporal/api/enums/v1/batch_operation.proto +3 -2
- package/sdk-core/protos/api_upstream/temporal/api/enums/v1/command_type.proto +3 -7
- package/sdk-core/protos/api_upstream/temporal/api/enums/v1/common.proto +3 -2
- package/sdk-core/protos/api_upstream/temporal/api/enums/v1/event_type.proto +8 -8
- package/sdk-core/protos/api_upstream/temporal/api/enums/v1/failed_cause.proto +25 -2
- package/sdk-core/protos/api_upstream/temporal/api/enums/v1/namespace.proto +2 -2
- package/sdk-core/protos/api_upstream/temporal/api/enums/v1/query.proto +2 -2
- package/sdk-core/protos/api_upstream/temporal/api/enums/v1/reset.proto +2 -2
- package/sdk-core/protos/api_upstream/temporal/api/enums/v1/schedule.proto +2 -2
- package/sdk-core/protos/api_upstream/temporal/api/enums/v1/task_queue.proto +2 -2
- package/sdk-core/protos/api_upstream/temporal/api/enums/v1/update.proto +24 -19
- package/sdk-core/protos/api_upstream/temporal/api/enums/v1/workflow.proto +2 -2
- package/sdk-core/protos/api_upstream/temporal/api/errordetails/v1/message.proto +2 -2
- package/sdk-core/protos/api_upstream/temporal/api/failure/v1/message.proto +2 -2
- package/sdk-core/protos/api_upstream/temporal/api/filter/v1/message.proto +2 -2
- package/sdk-core/protos/api_upstream/temporal/api/history/v1/message.proto +49 -26
- package/sdk-core/protos/api_upstream/temporal/api/namespace/v1/message.proto +4 -2
- package/sdk-core/protos/api_upstream/temporal/api/operatorservice/v1/request_response.proto +5 -2
- package/sdk-core/protos/api_upstream/temporal/api/operatorservice/v1/service.proto +2 -2
- package/sdk-core/protos/api_upstream/temporal/api/protocol/v1/message.proto +57 -0
- package/sdk-core/protos/api_upstream/temporal/api/query/v1/message.proto +2 -2
- package/sdk-core/protos/api_upstream/temporal/api/replication/v1/message.proto +2 -2
- package/sdk-core/protos/api_upstream/temporal/api/schedule/v1/message.proto +2 -2
- package/sdk-core/protos/api_upstream/temporal/api/sdk/v1/task_complete_metadata.proto +63 -0
- package/sdk-core/protos/api_upstream/temporal/api/taskqueue/v1/message.proto +2 -2
- package/sdk-core/protos/api_upstream/temporal/api/update/v1/message.proto +71 -6
- package/sdk-core/protos/api_upstream/temporal/api/version/v1/message.proto +2 -2
- package/sdk-core/protos/api_upstream/temporal/api/workflow/v1/message.proto +2 -2
- package/sdk-core/protos/api_upstream/temporal/api/workflowservice/v1/request_response.proto +64 -28
- package/sdk-core/protos/api_upstream/temporal/api/workflowservice/v1/service.proto +4 -4
- package/sdk-core/protos/local/temporal/sdk/core/activity_result/activity_result.proto +7 -8
- package/sdk-core/protos/local/temporal/sdk/core/activity_task/activity_task.proto +10 -7
- package/sdk-core/protos/local/temporal/sdk/core/child_workflow/child_workflow.proto +19 -30
- package/sdk-core/protos/local/temporal/sdk/core/common/common.proto +1 -0
- package/sdk-core/protos/local/temporal/sdk/core/core_interface.proto +1 -0
- package/sdk-core/protos/local/temporal/sdk/core/external_data/external_data.proto +8 -0
- package/sdk-core/protos/local/temporal/sdk/core/workflow_activation/workflow_activation.proto +67 -60
- package/sdk-core/protos/local/temporal/sdk/core/workflow_commands/workflow_commands.proto +85 -84
- package/sdk-core/protos/local/temporal/sdk/core/workflow_completion/workflow_completion.proto +9 -3
- package/sdk-core/protos/testsrv_upstream/temporal/api/testservice/v1/request_response.proto +2 -2
- package/sdk-core/protos/testsrv_upstream/temporal/api/testservice/v1/service.proto +2 -2
- package/sdk-core/sdk/Cargo.toml +5 -4
- package/sdk-core/sdk/src/lib.rs +108 -26
- package/sdk-core/sdk/src/workflow_context/options.rs +7 -1
- package/sdk-core/sdk/src/workflow_context.rs +24 -17
- package/sdk-core/sdk/src/workflow_future.rs +16 -15
- package/sdk-core/sdk-core-protos/Cargo.toml +5 -2
- package/sdk-core/sdk-core-protos/build.rs +36 -2
- package/sdk-core/sdk-core-protos/src/history_builder.rs +138 -106
- package/sdk-core/sdk-core-protos/src/history_info.rs +10 -1
- package/sdk-core/sdk-core-protos/src/lib.rs +272 -87
- package/sdk-core/sdk-core-protos/src/task_token.rs +12 -2
- package/sdk-core/test-utils/Cargo.toml +3 -1
- package/sdk-core/test-utils/src/canned_histories.rs +106 -296
- package/sdk-core/test-utils/src/histfetch.rs +1 -1
- package/sdk-core/test-utils/src/lib.rs +82 -23
- package/sdk-core/test-utils/src/wf_input_saver.rs +50 -0
- package/sdk-core/test-utils/src/workflows.rs +29 -0
- package/sdk-core/tests/fuzzy_workflow.rs +130 -0
- package/sdk-core/tests/{load_tests.rs → heavy_tests.rs} +125 -51
- package/sdk-core/tests/integ_tests/ephemeral_server_tests.rs +25 -3
- package/sdk-core/tests/integ_tests/heartbeat_tests.rs +10 -5
- package/sdk-core/tests/integ_tests/metrics_tests.rs +218 -16
- package/sdk-core/tests/integ_tests/polling_tests.rs +4 -47
- package/sdk-core/tests/integ_tests/queries_tests.rs +5 -128
- package/sdk-core/tests/integ_tests/visibility_tests.rs +83 -25
- package/sdk-core/tests/integ_tests/workflow_tests/activities.rs +161 -72
- package/sdk-core/tests/integ_tests/workflow_tests/cancel_external.rs +1 -0
- package/sdk-core/tests/integ_tests/workflow_tests/cancel_wf.rs +6 -13
- package/sdk-core/tests/integ_tests/workflow_tests/child_workflows.rs +80 -3
- package/sdk-core/tests/integ_tests/workflow_tests/continue_as_new.rs +6 -2
- package/sdk-core/tests/integ_tests/workflow_tests/determinism.rs +3 -10
- package/sdk-core/tests/integ_tests/workflow_tests/local_activities.rs +94 -200
- package/sdk-core/tests/integ_tests/workflow_tests/modify_wf_properties.rs +2 -4
- package/sdk-core/tests/integ_tests/workflow_tests/patches.rs +34 -28
- package/sdk-core/tests/integ_tests/workflow_tests/replay.rs +76 -7
- package/sdk-core/tests/integ_tests/workflow_tests/resets.rs +1 -0
- package/sdk-core/tests/integ_tests/workflow_tests/signals.rs +18 -14
- package/sdk-core/tests/integ_tests/workflow_tests/stickyness.rs +6 -20
- package/sdk-core/tests/integ_tests/workflow_tests/timers.rs +10 -21
- package/sdk-core/tests/integ_tests/workflow_tests/upsert_search_attrs.rs +7 -8
- package/sdk-core/tests/integ_tests/workflow_tests.rs +13 -14
- package/sdk-core/tests/main.rs +3 -13
- package/sdk-core/tests/runner.rs +75 -36
- package/sdk-core/tests/wf_input_replay.rs +32 -0
- package/src/conversions.rs +14 -8
- package/src/runtime.rs +9 -8
- package/ts/index.ts +8 -6
- package/sdk-core/bridge-ffi/Cargo.toml +0 -24
- package/sdk-core/bridge-ffi/LICENSE.txt +0 -23
- package/sdk-core/bridge-ffi/build.rs +0 -25
- package/sdk-core/bridge-ffi/include/sdk-core-bridge.h +0 -224
- package/sdk-core/bridge-ffi/src/lib.rs +0 -746
- package/sdk-core/bridge-ffi/src/wrappers.rs +0 -221
- package/sdk-core/protos/local/temporal/sdk/core/bridge/bridge.proto +0 -210
- package/sdk-core/sdk/src/conversions.rs +0 -8
|
@@ -64,21 +64,21 @@ use syn::{
|
|
|
64
64
|
/// }
|
|
65
65
|
///
|
|
66
66
|
/// impl Locked {
|
|
67
|
-
/// fn on_card_readable(&self, shared_dat: SharedState, data: CardData)
|
|
67
|
+
/// fn on_card_readable(&self, shared_dat: &mut SharedState, data: CardData)
|
|
68
68
|
/// -> CardReaderTransition<ReadingCardOrLocked> {
|
|
69
|
-
/// match shared_dat.last_id {
|
|
69
|
+
/// match &shared_dat.last_id {
|
|
70
70
|
/// // Arbitrarily deny the same person entering twice in a row
|
|
71
|
-
/// Some(d) if d == data => TransitionResult::ok(vec![], Locked {}.into()),
|
|
71
|
+
/// Some(d) if d == &data => TransitionResult::ok(vec![], Locked {}.into()),
|
|
72
72
|
/// _ => {
|
|
73
73
|
/// // Otherwise issue a processing command. This illustrates using the same handler
|
|
74
74
|
/// // for different destinations
|
|
75
|
-
///
|
|
75
|
+
/// shared_dat.last_id = Some(data.clone());
|
|
76
|
+
/// TransitionResult::ok(
|
|
76
77
|
/// vec![
|
|
77
78
|
/// Commands::ProcessData(data.clone()),
|
|
78
79
|
/// Commands::StartBlinkingLight,
|
|
79
80
|
/// ],
|
|
80
|
-
/// ReadingCard { card_data: data
|
|
81
|
-
/// SharedState { last_id: Some(data) }
|
|
81
|
+
/// ReadingCard { card_data: data }.into(),
|
|
82
82
|
/// )
|
|
83
83
|
/// }
|
|
84
84
|
/// }
|
|
@@ -96,19 +96,19 @@ use syn::{
|
|
|
96
96
|
///
|
|
97
97
|
/// # fn main() -> Result<(), Box<dyn std::error::Error>> {
|
|
98
98
|
/// let crs = CardReaderState::Locked(Locked {});
|
|
99
|
-
/// let mut cr = CardReader
|
|
100
|
-
/// let cmds = cr.
|
|
99
|
+
/// let mut cr = CardReader::from_parts(crs, SharedState { last_id: None });
|
|
100
|
+
/// let cmds = cr.on_event(CardReaderEvents::CardReadable("badguy".to_string()))?;
|
|
101
101
|
/// assert_eq!(cmds[0], Commands::ProcessData("badguy".to_string()));
|
|
102
102
|
/// assert_eq!(cmds[1], Commands::StartBlinkingLight);
|
|
103
103
|
///
|
|
104
|
-
/// let cmds = cr.
|
|
104
|
+
/// let cmds = cr.on_event(CardReaderEvents::CardRejected)?;
|
|
105
105
|
/// assert_eq!(cmds[0], Commands::StopBlinkingLight);
|
|
106
106
|
///
|
|
107
|
-
/// let cmds = cr.
|
|
107
|
+
/// let cmds = cr.on_event(CardReaderEvents::CardReadable("goodguy".to_string()))?;
|
|
108
108
|
/// assert_eq!(cmds[0], Commands::ProcessData("goodguy".to_string()));
|
|
109
109
|
/// assert_eq!(cmds[1], Commands::StartBlinkingLight);
|
|
110
110
|
///
|
|
111
|
-
/// let cmds = cr.
|
|
111
|
+
/// let cmds = cr.on_event(CardReaderEvents::CardAccepted)?;
|
|
112
112
|
/// assert_eq!(cmds[0], Commands::StopBlinkingLight);
|
|
113
113
|
/// # Ok(())
|
|
114
114
|
/// # }
|
|
@@ -132,17 +132,17 @@ use syn::{
|
|
|
132
132
|
/// The macro will generate a few things:
|
|
133
133
|
/// * A struct for the overall state machine, named with the provided name. Here:
|
|
134
134
|
/// ```text
|
|
135
|
-
/// struct
|
|
136
|
-
/// state:
|
|
137
|
-
/// shared_state:
|
|
135
|
+
/// struct CardReader {
|
|
136
|
+
/// state: CardReaderState,
|
|
137
|
+
/// shared_state: SharedState,
|
|
138
138
|
/// }
|
|
139
139
|
/// ```
|
|
140
140
|
/// * An enum with a variant for each state, named with the provided name + "State".
|
|
141
141
|
/// ```text
|
|
142
|
-
/// enum
|
|
142
|
+
/// enum CardReaderState {
|
|
143
143
|
/// Locked(Locked),
|
|
144
144
|
/// ReadingCard(ReadingCard),
|
|
145
|
-
///
|
|
145
|
+
/// DoorOpen(DoorOpen),
|
|
146
146
|
/// }
|
|
147
147
|
/// ```
|
|
148
148
|
///
|
|
@@ -154,15 +154,18 @@ use syn::{
|
|
|
154
154
|
/// * An enum with a variant for each event. You are expected to define the type (if any) contained
|
|
155
155
|
/// in the event variant.
|
|
156
156
|
/// ```text
|
|
157
|
-
/// enum
|
|
158
|
-
///
|
|
157
|
+
/// enum CardReaderEvents {
|
|
158
|
+
/// DoorClosed,
|
|
159
|
+
/// CardAccepted,
|
|
160
|
+
/// CardRejected,
|
|
161
|
+
/// CardReadable(CardData),
|
|
159
162
|
/// }
|
|
160
163
|
/// ```
|
|
161
164
|
/// * An implementation of the [StateMachine](trait.StateMachine.html) trait for the generated state
|
|
162
|
-
/// machine enum (in this case, `
|
|
165
|
+
/// machine enum (in this case, `CardReader`)
|
|
163
166
|
/// * A type alias for a [TransitionResult](enum.TransitionResult.html) with the appropriate generic
|
|
164
167
|
/// parameters set for your machine. It is named as your machine with `Transition` appended. In
|
|
165
|
-
/// this case, `
|
|
168
|
+
/// this case, `CardReaderTransition`.
|
|
166
169
|
#[proc_macro]
|
|
167
170
|
pub fn fsm(input: TokenStream) -> TokenStream {
|
|
168
171
|
let def: StateMachineDefinition = parse_macro_input!(input as StateMachineDefinition);
|
|
@@ -217,7 +220,7 @@ impl Parse for StateMachineDefinition {
|
|
|
217
220
|
// not ideal.
|
|
218
221
|
let trans_set: HashSet<_> = transitions.iter().collect();
|
|
219
222
|
if trans_set.len() != transitions.len() {
|
|
220
|
-
return Err(
|
|
223
|
+
return Err(Error::new(
|
|
221
224
|
input.span(),
|
|
222
225
|
"Duplicate transitions are not allowed!",
|
|
223
226
|
));
|
|
@@ -346,12 +349,12 @@ impl StateMachineDefinition {
|
|
|
346
349
|
let name = &self.name;
|
|
347
350
|
let name_str = &self.name.to_string();
|
|
348
351
|
|
|
349
|
-
let transition_result_name = Ident::new(&format!("{}Transition"
|
|
352
|
+
let transition_result_name = Ident::new(&format!("{name}Transition"), name.span());
|
|
350
353
|
let transition_type_alias = quote! {
|
|
351
354
|
type #transition_result_name<Ds, Sm = #name> = TransitionResult<Sm, Ds>;
|
|
352
355
|
};
|
|
353
356
|
|
|
354
|
-
let state_enum_name = Ident::new(&format!("{}State"
|
|
357
|
+
let state_enum_name = Ident::new(&format!("{name}State"), name.span());
|
|
355
358
|
// If user has not defined any shared state, use the unit type.
|
|
356
359
|
let shared_state_type = self
|
|
357
360
|
.shared_state_type
|
|
@@ -360,7 +363,7 @@ impl StateMachineDefinition {
|
|
|
360
363
|
let machine_struct = quote! {
|
|
361
364
|
#[derive(Clone)]
|
|
362
365
|
#visibility struct #name {
|
|
363
|
-
state:
|
|
366
|
+
state: ::core::option::Option<#state_enum_name>,
|
|
364
367
|
shared_state: #shared_state_type
|
|
365
368
|
}
|
|
366
369
|
};
|
|
@@ -390,7 +393,7 @@ impl StateMachineDefinition {
|
|
|
390
393
|
|
|
391
394
|
// Build the events enum
|
|
392
395
|
let events: HashSet<Variant> = self.transitions.iter().map(|t| t.event.clone()).collect();
|
|
393
|
-
let events_enum_name = Ident::new(&format!("{}Events"
|
|
396
|
+
let events_enum_name = Ident::new(&format!("{name}Events"), name.span());
|
|
394
397
|
let events: Vec<_> = events
|
|
395
398
|
.into_iter()
|
|
396
399
|
.map(|v| {
|
|
@@ -424,8 +427,18 @@ impl StateMachineDefinition {
|
|
|
424
427
|
statemap.insert(s.clone(), vec![]);
|
|
425
428
|
}
|
|
426
429
|
}
|
|
430
|
+
let transition_result_transform = quote! {
|
|
431
|
+
match res.into_cmd_result() {
|
|
432
|
+
Ok((cmds, state)) => {
|
|
433
|
+
self.state = Some(state);
|
|
434
|
+
Ok(cmds)
|
|
435
|
+
}
|
|
436
|
+
Err(e) => Err(e)
|
|
437
|
+
}
|
|
438
|
+
};
|
|
427
439
|
let mut multi_dest_enums = vec![];
|
|
428
440
|
let state_branches: Vec<_> = statemap.into_iter().map(|(from, transitions)| {
|
|
441
|
+
let occupied_current_state = quote! { Some(#state_enum_name::#from(state_data)) };
|
|
429
442
|
// Merge transition dest states with the same handler
|
|
430
443
|
let transitions = merge_transition_dests(transitions);
|
|
431
444
|
let event_branches = transitions
|
|
@@ -467,27 +480,27 @@ impl StateMachineDefinition {
|
|
|
467
480
|
match ts.event.fields {
|
|
468
481
|
Fields::Unnamed(_) => {
|
|
469
482
|
let arglist = if ts.mutates_shared {
|
|
470
|
-
quote! {self.shared_state, val}
|
|
483
|
+
quote! {&mut self.shared_state, val}
|
|
471
484
|
} else {
|
|
472
485
|
quote! {val}
|
|
473
486
|
};
|
|
474
|
-
quote_spanned! {span=>
|
|
487
|
+
quote_spanned! { span =>
|
|
475
488
|
#events_enum_name::#ev_variant(val) => {
|
|
476
489
|
let res: #trans_type = state_data.#ts_fn(#arglist);
|
|
477
|
-
|
|
490
|
+
#transition_result_transform
|
|
478
491
|
}
|
|
479
492
|
}
|
|
480
493
|
}
|
|
481
494
|
Fields::Unit => {
|
|
482
495
|
let arglist = if ts.mutates_shared {
|
|
483
|
-
quote! {self.shared_state}
|
|
496
|
+
quote! {&mut self.shared_state}
|
|
484
497
|
} else {
|
|
485
498
|
quote! {}
|
|
486
499
|
};
|
|
487
|
-
quote_spanned! {span=>
|
|
500
|
+
quote_spanned! { span =>
|
|
488
501
|
#events_enum_name::#ev_variant => {
|
|
489
502
|
let res: #trans_type = state_data.#ts_fn(#arglist);
|
|
490
|
-
|
|
503
|
+
#transition_result_transform
|
|
491
504
|
}
|
|
492
505
|
}
|
|
493
506
|
}
|
|
@@ -498,39 +511,49 @@ impl StateMachineDefinition {
|
|
|
498
511
|
// using `Default`.
|
|
499
512
|
if let [new_state] = ts.to.as_slice() {
|
|
500
513
|
let span = new_state.span();
|
|
501
|
-
let default_trans = quote_spanned! {span=>
|
|
502
|
-
TransitionResult::<
|
|
503
|
-
|
|
514
|
+
let default_trans = quote_spanned! { span =>
|
|
515
|
+
let res = TransitionResult::<Self, #new_state>::from::<#from>(state_data);
|
|
516
|
+
#transition_result_transform
|
|
517
|
+
};
|
|
504
518
|
let span = ts.event.span();
|
|
505
519
|
match ts.event.fields {
|
|
506
|
-
Fields::Unnamed(_) => quote_spanned! {span=>
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
Fields::Unit => quote_spanned! {span=>
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
520
|
+
Fields::Unnamed(_) => quote_spanned! { span =>
|
|
521
|
+
#events_enum_name::#ev_variant(_val) => {
|
|
522
|
+
#default_trans
|
|
523
|
+
}
|
|
524
|
+
},
|
|
525
|
+
Fields::Unit => quote_spanned! { span =>
|
|
526
|
+
#events_enum_name::#ev_variant => {
|
|
527
|
+
#default_trans
|
|
528
|
+
}
|
|
529
|
+
},
|
|
516
530
|
Fields::Named(_) => unreachable!(),
|
|
517
531
|
}
|
|
518
|
-
|
|
519
532
|
} else {
|
|
520
|
-
unreachable!("It should be impossible to have more than one dest state
|
|
533
|
+
unreachable!("It should be impossible to have more than one dest state \
|
|
534
|
+
in no-handler transitions")
|
|
521
535
|
}
|
|
522
536
|
}
|
|
523
537
|
})
|
|
524
|
-
// Since most states won't handle every possible event, return an error to that
|
|
538
|
+
// Since most states won't handle every possible event, return an error to that
|
|
539
|
+
// effect
|
|
525
540
|
.chain(std::iter::once(
|
|
526
|
-
quote! { _ => {
|
|
541
|
+
quote! { _ => {
|
|
542
|
+
// Restore state in event the transition doesn't match
|
|
543
|
+
self.state = #occupied_current_state;
|
|
544
|
+
return Err(::rustfsm::MachineError::InvalidTransition)
|
|
545
|
+
} },
|
|
527
546
|
));
|
|
528
547
|
quote! {
|
|
529
|
-
#
|
|
548
|
+
#occupied_current_state => match event {
|
|
530
549
|
#(#event_branches),*
|
|
531
550
|
}
|
|
532
551
|
}
|
|
533
|
-
}).
|
|
552
|
+
}).chain(std::iter::once(
|
|
553
|
+
quote! {
|
|
554
|
+
None => Err(::rustfsm::MachineError::InvalidTransition)
|
|
555
|
+
}
|
|
556
|
+
)).collect();
|
|
534
557
|
|
|
535
558
|
let viz_str = self.visualize();
|
|
536
559
|
|
|
@@ -546,19 +569,21 @@ impl StateMachineDefinition {
|
|
|
546
569
|
#name_str
|
|
547
570
|
}
|
|
548
571
|
|
|
549
|
-
fn on_event(self, event: #events_enum_name)
|
|
550
|
-
-> ::
|
|
551
|
-
|
|
572
|
+
fn on_event(&mut self, event: #events_enum_name)
|
|
573
|
+
-> ::core::result::Result<::std::vec::Vec<Self::Command>,
|
|
574
|
+
::rustfsm::MachineError<Self::Error>> {
|
|
575
|
+
let taken_state = self.state.take();
|
|
576
|
+
match taken_state {
|
|
552
577
|
#(#state_branches),*
|
|
553
578
|
}
|
|
554
579
|
}
|
|
555
580
|
|
|
556
581
|
fn state(&self) -> &Self::State {
|
|
557
|
-
|
|
582
|
+
self.state.as_ref().unwrap()
|
|
558
583
|
}
|
|
559
584
|
|
|
560
585
|
fn set_state(&mut self, new: Self::State) {
|
|
561
|
-
self.state = new
|
|
586
|
+
self.state = Some(new)
|
|
562
587
|
}
|
|
563
588
|
|
|
564
589
|
fn shared_state(&self) -> &Self::SharedState{
|
|
@@ -566,11 +591,11 @@ impl StateMachineDefinition {
|
|
|
566
591
|
}
|
|
567
592
|
|
|
568
593
|
fn has_reached_final_state(&self) -> bool {
|
|
569
|
-
self.state.is_final()
|
|
594
|
+
self.state.as_ref().unwrap().is_final()
|
|
570
595
|
}
|
|
571
596
|
|
|
572
|
-
fn from_parts(
|
|
573
|
-
Self { shared_state: shared, state }
|
|
597
|
+
fn from_parts(state: Self::State, shared: Self::SharedState) -> Self {
|
|
598
|
+
Self { shared_state: shared, state: Some(state) }
|
|
574
599
|
}
|
|
575
600
|
|
|
576
601
|
fn visualizer() -> &'static str {
|
|
@@ -616,11 +641,11 @@ impl StateMachineDefinition {
|
|
|
616
641
|
self.all_states()
|
|
617
642
|
.iter()
|
|
618
643
|
.filter(|s| self.is_final_state(s))
|
|
619
|
-
.map(|s| format!("{} --> [*]"
|
|
644
|
+
.map(|s| format!("{s} --> [*]")),
|
|
620
645
|
)
|
|
621
646
|
.collect();
|
|
622
647
|
let transitions = transitions.join("\n");
|
|
623
|
-
format!("@startuml\n{}\n@enduml"
|
|
648
|
+
format!("@startuml\n{transitions}\n@enduml")
|
|
624
649
|
}
|
|
625
650
|
}
|
|
626
651
|
|
|
@@ -643,5 +668,5 @@ fn merge_transition_dests(transitions: Vec<Transition>) -> Vec<Transition> {
|
|
|
643
668
|
}
|
|
644
669
|
}
|
|
645
670
|
}
|
|
646
|
-
map.
|
|
671
|
+
map.into_values().collect()
|
|
647
672
|
}
|
|
@@ -19,44 +19,12 @@ pub trait StateMachine: Sized {
|
|
|
19
19
|
/// The type used to represent commands the machine issues upon transitions.
|
|
20
20
|
type Command;
|
|
21
21
|
|
|
22
|
-
/// Handle an incoming event, returning
|
|
23
|
-
/// to
|
|
24
|
-
fn on_event(
|
|
25
|
-
|
|
26
|
-
/// Handle an incoming event and mutate the state machine to update to the new state and apply
|
|
27
|
-
/// any changes to shared state.
|
|
28
|
-
///
|
|
29
|
-
/// Returns the commands issued by the transition on success, otherwise a [MachineError]
|
|
30
|
-
fn on_event_mut(
|
|
22
|
+
/// Handle an incoming event, returning any new commands or an error. Implementations may
|
|
23
|
+
/// mutate current state, possibly moving to a new state.
|
|
24
|
+
fn on_event(
|
|
31
25
|
&mut self,
|
|
32
26
|
event: Self::Event,
|
|
33
|
-
) -> Result<Vec<Self::Command>, MachineError<Self::Error
|
|
34
|
-
where
|
|
35
|
-
Self: Clone,
|
|
36
|
-
{
|
|
37
|
-
// NOTE: This clone is actually nice in some sense, giving us a kind of transactionality.
|
|
38
|
-
// However if there are really big things in state it could be an issue.
|
|
39
|
-
let res = self.clone().on_event(event);
|
|
40
|
-
match res {
|
|
41
|
-
TransitionResult::Ok {
|
|
42
|
-
commands,
|
|
43
|
-
new_state,
|
|
44
|
-
shared_state,
|
|
45
|
-
} => {
|
|
46
|
-
*self = Self::from_parts(shared_state, new_state);
|
|
47
|
-
Ok(commands)
|
|
48
|
-
}
|
|
49
|
-
TransitionResult::OkNoShare {
|
|
50
|
-
commands,
|
|
51
|
-
new_state,
|
|
52
|
-
} => {
|
|
53
|
-
self.set_state(new_state);
|
|
54
|
-
Ok(commands)
|
|
55
|
-
}
|
|
56
|
-
TransitionResult::InvalidTransition => Err(MachineError::InvalidTransition),
|
|
57
|
-
TransitionResult::Err(e) => Err(MachineError::Underlying(e)),
|
|
58
|
-
}
|
|
59
|
-
}
|
|
27
|
+
) -> Result<Vec<Self::Command>, MachineError<Self::Error>>;
|
|
60
28
|
|
|
61
29
|
fn name(&self) -> &str;
|
|
62
30
|
|
|
@@ -71,7 +39,7 @@ pub trait StateMachine: Sized {
|
|
|
71
39
|
fn has_reached_final_state(&self) -> bool;
|
|
72
40
|
|
|
73
41
|
/// Given the shared data and new state, create a new instance.
|
|
74
|
-
fn from_parts(
|
|
42
|
+
fn from_parts(state: Self::State, shared: Self::SharedState) -> Self;
|
|
75
43
|
|
|
76
44
|
/// Return a PlantUML definition of the fsm that can be used to visualize it
|
|
77
45
|
fn visualizer() -> &'static str;
|
|
@@ -136,12 +104,6 @@ where
|
|
|
136
104
|
Ok {
|
|
137
105
|
commands: Vec<Machine::Command>,
|
|
138
106
|
new_state: DestinationState,
|
|
139
|
-
shared_state: Machine::SharedState,
|
|
140
|
-
},
|
|
141
|
-
/// The transition was successful with no shared state change
|
|
142
|
-
OkNoShare {
|
|
143
|
-
commands: Vec<Machine::Command>,
|
|
144
|
-
new_state: DestinationState,
|
|
145
107
|
},
|
|
146
108
|
/// There was some error performing the transition
|
|
147
109
|
Err(Machine::Error),
|
|
@@ -157,24 +119,10 @@ where
|
|
|
157
119
|
pub fn ok<CI>(commands: CI, new_state: Ds) -> Self
|
|
158
120
|
where
|
|
159
121
|
CI: IntoIterator<Item = Sm::Command>,
|
|
160
|
-
{
|
|
161
|
-
Self::OkNoShare {
|
|
162
|
-
commands: commands.into_iter().collect(),
|
|
163
|
-
new_state,
|
|
164
|
-
}
|
|
165
|
-
}
|
|
166
|
-
|
|
167
|
-
/// Produce a transition with the provided commands to the provided state with shared state
|
|
168
|
-
/// changes
|
|
169
|
-
pub fn ok_shared<CI, SS>(commands: CI, new_state: Ds, new_shared: SS) -> Self
|
|
170
|
-
where
|
|
171
|
-
CI: IntoIterator<Item = Sm::Command>,
|
|
172
|
-
SS: Into<Sm::SharedState>,
|
|
173
122
|
{
|
|
174
123
|
Self::Ok {
|
|
175
124
|
commands: commands.into_iter().collect(),
|
|
176
125
|
new_state,
|
|
177
|
-
shared_state: new_shared.into(),
|
|
178
126
|
}
|
|
179
127
|
}
|
|
180
128
|
|
|
@@ -185,7 +133,7 @@ where
|
|
|
185
133
|
CurrentState: Into<Ds>,
|
|
186
134
|
{
|
|
187
135
|
let as_dest: Ds = current_state.into();
|
|
188
|
-
Self::
|
|
136
|
+
Self::Ok {
|
|
189
137
|
commands: vec![],
|
|
190
138
|
new_state: as_dest,
|
|
191
139
|
}
|
|
@@ -202,16 +150,20 @@ where
|
|
|
202
150
|
where
|
|
203
151
|
CI: IntoIterator<Item = Sm::Command>,
|
|
204
152
|
{
|
|
205
|
-
Self::
|
|
153
|
+
Self::Ok {
|
|
206
154
|
commands: commands.into_iter().collect(),
|
|
207
155
|
new_state: Ds::default(),
|
|
208
156
|
}
|
|
209
157
|
}
|
|
158
|
+
}
|
|
210
159
|
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
160
|
+
impl<Sm, Ds> Default for TransitionResult<Sm, Ds>
|
|
161
|
+
where
|
|
162
|
+
Sm: StateMachine,
|
|
163
|
+
Ds: Into<Sm::State> + Default,
|
|
164
|
+
{
|
|
165
|
+
fn default() -> Self {
|
|
166
|
+
Self::Ok {
|
|
215
167
|
commands: vec![],
|
|
216
168
|
new_state: Ds::default(),
|
|
217
169
|
}
|
|
@@ -230,20 +182,26 @@ where
|
|
|
230
182
|
TransitionResult::Ok {
|
|
231
183
|
commands,
|
|
232
184
|
new_state,
|
|
233
|
-
shared_state,
|
|
234
185
|
} => TransitionResult::Ok {
|
|
235
186
|
commands,
|
|
236
187
|
new_state: new_state.into(),
|
|
237
|
-
shared_state,
|
|
238
188
|
},
|
|
239
|
-
TransitionResult::
|
|
240
|
-
|
|
189
|
+
TransitionResult::Err(e) => TransitionResult::Err(e),
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
/// Transforms the transition result into a machine-ready outcome with commands and new state,
|
|
194
|
+
/// or a [MachineError]
|
|
195
|
+
#[allow(clippy::type_complexity)]
|
|
196
|
+
pub fn into_cmd_result(self) -> Result<(Vec<Sm::Command>, Sm::State), MachineError<Sm::Error>> {
|
|
197
|
+
let general = self.into_general();
|
|
198
|
+
match general {
|
|
199
|
+
TransitionResult::Ok {
|
|
241
200
|
new_state,
|
|
242
|
-
} => TransitionResult::OkNoShare {
|
|
243
201
|
commands,
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
TransitionResult::Err(e) =>
|
|
202
|
+
} => Ok((commands, new_state)),
|
|
203
|
+
TransitionResult::InvalidTransition => Err(MachineError::InvalidTransition),
|
|
204
|
+
TransitionResult::Err(e) => Err(MachineError::Underlying(e)),
|
|
247
205
|
}
|
|
248
206
|
}
|
|
249
207
|
}
|
|
Binary file
|
|
Binary file
|
|
@@ -23,7 +23,7 @@ PROTO_ROOT := .
|
|
|
23
23
|
PROTO_FILES = $(shell find $(PROTO_ROOT) -name "*.proto")
|
|
24
24
|
PROTO_DIRS = $(sort $(dir $(PROTO_FILES)))
|
|
25
25
|
PROTO_OUT := .gen
|
|
26
|
-
PROTO_IMPORTS
|
|
26
|
+
PROTO_IMPORTS = -I=$(PROTO_ROOT) -I=$(shell go list -modfile build/go.mod -m -f '{{.Dir}}' github.com/temporalio/gogo-protobuf)/protobuf
|
|
27
27
|
|
|
28
28
|
$(PROTO_OUT):
|
|
29
29
|
mkdir $(PROTO_OUT)
|
|
@@ -37,7 +37,7 @@ go-grpc: clean $(PROTO_OUT)
|
|
|
37
37
|
|
|
38
38
|
gogo-grpc: clean $(PROTO_OUT)
|
|
39
39
|
printf $(COLOR) "Compile for gogo-gRPC..."
|
|
40
|
-
$(foreach PROTO_DIR,$(PROTO_DIRS),protoc --fatal_warnings $(PROTO_IMPORTS) --gogoslick_out=Mgoogle/protobuf/wrappers.proto=github.com/gogo/protobuf/types,Mgoogle/protobuf/duration.proto=github.com/gogo/protobuf/types,Mgoogle/protobuf/descriptor.proto=github.com/golang/protobuf/protoc-gen-go/descriptor,Mgoogle/protobuf/timestamp.proto=github.com/gogo/protobuf/types,plugins=grpc,paths=source_relative:$(PROTO_OUT) $(PROTO_DIR)*.proto;)
|
|
40
|
+
$(foreach PROTO_DIR,$(PROTO_DIRS),protoc --fatal_warnings $(PROTO_IMPORTS) --gogoslick_out=Mgoogle/protobuf/any.proto=github.com/gogo/protobuf/types,Mgoogle/protobuf/wrappers.proto=github.com/gogo/protobuf/types,Mgoogle/protobuf/duration.proto=github.com/gogo/protobuf/types,Mgoogle/protobuf/descriptor.proto=github.com/golang/protobuf/protoc-gen-go/descriptor,Mgoogle/protobuf/timestamp.proto=github.com/gogo/protobuf/types,plugins=grpc,paths=source_relative:$(PROTO_OUT) $(PROTO_DIR)*.proto;)
|
|
41
41
|
|
|
42
42
|
fix-path:
|
|
43
43
|
mv -f $(PROTO_OUT)/temporal/api/* $(PROTO_OUT) && rm -rf $(PROTO_OUT)/temporal
|
|
@@ -45,21 +45,21 @@ fix-path:
|
|
|
45
45
|
##### Plugins & tools #####
|
|
46
46
|
grpc-install: gogo-protobuf-install
|
|
47
47
|
printf $(COLOR) "Install/update gRPC plugins..."
|
|
48
|
-
go install google.golang.org/grpc/cmd/protoc-gen-go-grpc@
|
|
48
|
+
go install google.golang.org/grpc/cmd/protoc-gen-go-grpc@latest
|
|
49
49
|
|
|
50
50
|
gogo-protobuf-install: go-protobuf-install
|
|
51
|
-
|
|
51
|
+
go install -modfile build/go.mod github.com/temporalio/gogo-protobuf/protoc-gen-gogoslick
|
|
52
52
|
|
|
53
53
|
go-protobuf-install:
|
|
54
54
|
go install github.com/golang/protobuf/protoc-gen-go@v1.5.2
|
|
55
55
|
|
|
56
56
|
api-linter-install:
|
|
57
57
|
printf $(COLOR) "Install/update api-linter..."
|
|
58
|
-
go install github.com/googleapis/api-linter/cmd/api-linter@v1.
|
|
58
|
+
go install github.com/googleapis/api-linter/cmd/api-linter@v1.32.3
|
|
59
59
|
|
|
60
60
|
buf-install:
|
|
61
61
|
printf $(COLOR) "Install/update buf..."
|
|
62
|
-
go install github.com/bufbuild/buf/cmd/buf@v1.
|
|
62
|
+
go install github.com/bufbuild/buf/cmd/buf@v1.6.0
|
|
63
63
|
|
|
64
64
|
##### Linters #####
|
|
65
65
|
api-linter:
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
github.com/kisielk/errcheck v1.2.0/go.mod h1:/BMXB+zMLi60iA8Vv6Ksmxu/1UDYcXs4uQLJ+jE2L00=
|
|
2
|
+
github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck=
|
|
3
|
+
github.com/temporalio/gogo-protobuf v1.22.1 h1:K5ja5MqmCQKo4tlX7u3g+ZJqbvRr0589ss2cZQx2dSM=
|
|
4
|
+
github.com/temporalio/gogo-protobuf v1.22.1/go.mod h1:tCaEv+fB8tsyLgoaqKr78K/JOhdRe684yyo0z30SHyA=
|
|
5
|
+
golang.org/x/tools v0.0.0-20181030221726-6c7e314b6563/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
// The MIT License
|
|
2
|
+
//
|
|
3
|
+
// Copyright (c) 2020 Temporal Technologies Inc. All rights reserved.
|
|
4
|
+
//
|
|
5
|
+
// Copyright (c) 2020 Uber Technologies, Inc.
|
|
6
|
+
//
|
|
7
|
+
// Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
8
|
+
// of this software and associated documentation files (the "Software"), to deal
|
|
9
|
+
// in the Software without restriction, including without limitation the rights
|
|
10
|
+
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
11
|
+
// copies of the Software, and to permit persons to whom the Software is
|
|
12
|
+
// furnished to do so, subject to the following conditions:
|
|
13
|
+
//
|
|
14
|
+
// The above copyright notice and this permission notice shall be included in
|
|
15
|
+
// all copies or substantial portions of the Software.
|
|
16
|
+
//
|
|
17
|
+
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
18
|
+
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
19
|
+
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
20
|
+
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
21
|
+
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
22
|
+
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
23
|
+
// THE SOFTWARE.
|
|
24
|
+
|
|
25
|
+
package build
|
|
26
|
+
|
|
27
|
+
import (
|
|
28
|
+
_ "github.com/temporalio/gogo-protobuf/gogoproto" // gogoproto is just a random package name for module.
|
|
29
|
+
)
|
|
@@ -28,8 +28,8 @@ option go_package = "go.temporal.io/api/batch/v1;batch";
|
|
|
28
28
|
option java_package = "io.temporal.api.batch.v1";
|
|
29
29
|
option java_multiple_files = true;
|
|
30
30
|
option java_outer_classname = "MessageProto";
|
|
31
|
-
option ruby_package = "
|
|
32
|
-
option csharp_namespace = "
|
|
31
|
+
option ruby_package = "Temporalio::Api::Batch::V1";
|
|
32
|
+
option csharp_namespace = "Temporalio.Api.Batch.V1";
|
|
33
33
|
|
|
34
34
|
import "dependencies/gogoproto/gogo.proto";
|
|
35
35
|
import "google/protobuf/timestamp.proto";
|
|
@@ -79,4 +79,11 @@ message BatchOperationSignal {
|
|
|
79
79
|
message BatchOperationCancellation {
|
|
80
80
|
// The identity of the worker/client
|
|
81
81
|
string identity = 1;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
// BatchOperationDeletion sends deletion requests to batch workflows.
|
|
85
|
+
// Keep the parameter in sync with temporal.api.workflowservice.v1.DeleteWorkflowExecutionRequest.
|
|
86
|
+
message BatchOperationDeletion {
|
|
87
|
+
// The identity of the worker/client
|
|
88
|
+
string identity = 1;
|
|
82
89
|
}
|