Skip to content

Commit 5eea7df

Browse files
committed
Remove release reason for now
1 parent daaf52a commit 5eea7df

File tree

5 files changed

+9
-20
lines changed

5 files changed

+9
-20
lines changed

core-api/src/worker.rs

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -239,7 +239,7 @@ pub trait SlotSupplier {
239239
fn mark_slot_used(&self, info: <Self::SlotKind as SlotKind>::Info<'_>);
240240

241241
/// Frees a slot.
242-
fn release_slot(&self, info: SlotReleaseReason);
242+
fn release_slot(&self);
243243

244244
/// If this implementation knows how many slots are available at any moment, it should return
245245
/// that here.
@@ -279,12 +279,6 @@ impl SlotSupplierPermit {
279279
}
280280
}
281281

282-
pub enum SlotReleaseReason {
283-
TaskComplete,
284-
NeverUsed,
285-
Error, // TODO: Details
286-
}
287-
288282
pub struct WorkflowSlotInfo<'a> {
289283
pub workflow_type: &'a str,
290284
// etc...

core/src/abstractions.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ use std::{
1212
},
1313
};
1414
use temporal_sdk_core_api::worker::{
15-
SlotKind, SlotReleaseReason, SlotReservationContext, SlotSupplier, SlotSupplierPermit,
15+
SlotKind, SlotReservationContext, SlotSupplier, SlotSupplierPermit,
1616
};
1717
use tokio::sync::watch;
1818
use tokio_util::sync::CancellationToken;
@@ -125,8 +125,7 @@ where
125125
metric_rec(false)
126126
}),
127127
release_fn: Box::new(move || {
128-
// TODO: Real release reason
129-
supp_c_c.release_slot(SlotReleaseReason::TaskComplete);
128+
supp_c_c.release_slot();
130129
ep_tx_c.send_modify(|ep| *ep -= 1);
131130
mrc(true)
132131
}),

core/src/core_tests/workflow_tasks.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,7 @@ use temporal_sdk_core_api::{
3333
errors::PollWfError,
3434
telemetry::metrics::TemporalMeter,
3535
worker::{
36-
SlotKind, SlotReleaseReason, SlotReservationContext, SlotSupplier, SlotSupplierPermit,
37-
WorkflowSlotKind,
36+
SlotKind, SlotReservationContext, SlotSupplier, SlotSupplierPermit, WorkflowSlotKind,
3837
},
3938
Worker as WorkerTrait,
4039
};
@@ -2899,7 +2898,7 @@ async fn slot_provider_cant_hand_out_more_permits_than_cache_size() {
28992898
Some(SlotSupplierPermit::default())
29002899
}
29012900
fn mark_slot_used(&self, _: <Self::SlotKind as SlotKind>::Info<'_>) {}
2902-
fn release_slot(&self, _: SlotReleaseReason) {}
2901+
fn release_slot(&self) {}
29032902
fn available_slots(&self) -> Option<usize> {
29042903
None
29052904
}

core/src/worker/slot_supplier.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
use std::{marker::PhantomData, sync::Arc};
22
use temporal_sdk_core_api::worker::{
3-
SlotKind, SlotReleaseReason, SlotReservationContext, SlotSupplier, SlotSupplierPermit,
4-
WorkerConfigBuilder,
3+
SlotKind, SlotReservationContext, SlotSupplier, SlotSupplierPermit, WorkerConfigBuilder,
54
};
65
use tokio::sync::Semaphore;
76

@@ -48,7 +47,7 @@ where
4847

4948
fn mark_slot_used(&self, _info: SK::Info<'_>) {}
5049

51-
fn release_slot(&self, _: SlotReleaseReason) {}
50+
fn release_slot(&self) {}
5251

5352
fn available_slots(&self) -> Option<usize> {
5453
Some(self.sem.available_permits())

core/src/worker/slot_supplier/resource_based.rs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,7 @@ use std::{
1010
};
1111
use temporal_sdk_core_api::{
1212
telemetry::metrics::{CoreMeter, GaugeF64, MetricAttributes, TemporalMeter},
13-
worker::{
14-
SlotKind, SlotReleaseReason, SlotReservationContext, SlotSupplier, SlotSupplierPermit,
15-
},
13+
worker::{SlotKind, SlotReservationContext, SlotSupplier, SlotSupplierPermit},
1614
};
1715
use tokio::{sync::watch, task::JoinHandle};
1816

@@ -159,7 +157,7 @@ where
159157

160158
fn mark_slot_used(&self, _info: SK::Info<'_>) {}
161159

162-
fn release_slot(&self, _info: SlotReleaseReason) {}
160+
fn release_slot(&self) {}
163161

164162
fn attach_metrics(&self, metrics: TemporalMeter) {
165163
self.inner.attach_metrics(metrics);

0 commit comments

Comments
 (0)