moose-lib 0.5.21__py3-none-any.whl → 0.5.23__py3-none-any.whl

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.

Potentially problematic release.


This version of moose-lib might be problematic. Click here for more details.

moose_lib/main.py CHANGED
@@ -242,6 +242,25 @@ class WorkflowClient:
242
242
  "body": str(e)
243
243
  }
244
244
 
245
+ def terminate(self, workflow_id: str) -> Dict[str, Any]:
246
+ try:
247
+ asyncio.run(self._terminate_workflow_async(workflow_id))
248
+ print(f"WorkflowClient - terminated workflow: {workflow_id}")
249
+ return {
250
+ "status": 200,
251
+ "body": f"Workflow terminated: {workflow_id}"
252
+ }
253
+ except Exception as e:
254
+ print(f"WorkflowClient - error while terminating workflow: {e}")
255
+ return {
256
+ "status": 400,
257
+ "body": str(e)
258
+ }
259
+
260
+ async def _terminate_workflow_async(self, workflow_id: str):
261
+ workflow_handle = self.temporal_client.get_workflow_handle(workflow_id)
262
+ await workflow_handle.terminate()
263
+
245
264
  async def _start_workflow_async(self, name: str, input_data: Any):
246
265
  # Extract configuration based on workflow type
247
266
  config = self._get_workflow_config(name)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: moose_lib
3
- Version: 0.5.21
3
+ Version: 0.5.23
4
4
  Home-page: https://www.fiveonefour.com/moose
5
5
  Author: Fiveonefour Labs Inc.
6
6
  Author-email: support@fiveonefour.com
@@ -4,7 +4,7 @@ moose_lib/commons.py,sha256=z63RPtdHFRMFvPDWIvOCYV6UHlib7si34RpD5VPa0Gs,3602
4
4
  moose_lib/data_models.py,sha256=FjFNd88WWCGMG5p5gV-Vjgp1cXARBeFapEHqDy0-WX8,9792
5
5
  moose_lib/dmv2-serializer.py,sha256=CL_Pvvg8tJOT8Qk6hywDNzY8MYGhMVdTOw8arZi3jng,49
6
6
  moose_lib/internal.py,sha256=6qKPGUPxJV3oNruKg76umw_P_TcMgVAuaijn-7EdHXQ,14659
7
- moose_lib/main.py,sha256=uyHkaPaKMOZGAgZrj8T4thRVC4cuPxP5CC0em2m83G8,16482
7
+ moose_lib/main.py,sha256=nmLVEHNnlwga6WjpU3y1fUBREJCh5mYStGbdNXYGVI8,17221
8
8
  moose_lib/query_param.py,sha256=FWhMXsdIexuJv57nG1YcepD-OZp7k4dNG4LkGVN1q-g,6486
9
9
  moose_lib/tasks.py,sha256=6MXA0j7nhvQILAJVTQHCAsquwrSOi2zAevghAc_7kXs,1554
10
10
  moose_lib/clients/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
@@ -32,7 +32,7 @@ tests/__init__.py,sha256=0Gh4yzPkkC3TzBGKhenpMIxJcRhyrrCfxLSfpTZnPMQ,53
32
32
  tests/conftest.py,sha256=ZVJNbnr4DwbcqkTmePW6U01zAzE6QD0kNAEZjPG1f4s,169
33
33
  tests/test_moose.py,sha256=mBsx_OYWmL8ppDzL_7Bd7xR6qf_i3-pCIO3wm2iQNaA,2136
34
34
  tests/test_redis_client.py,sha256=d9_MLYsJ4ecVil_jPB2gW3Q5aWnavxmmjZg2uYI3LVo,3256
35
- moose_lib-0.5.21.dist-info/METADATA,sha256=sSWj6a3JHY8iyjVhUNUPVtpCT48P8jgjGwQXamkqviE,730
36
- moose_lib-0.5.21.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
37
- moose_lib-0.5.21.dist-info/top_level.txt,sha256=XEns2-4aCmGp2XjJAeEH9TAUcGONLnSLy6ycT9FSJh8,16
38
- moose_lib-0.5.21.dist-info/RECORD,,
35
+ moose_lib-0.5.23.dist-info/METADATA,sha256=-ZU_EhpktG5j2r4fIsYPiALD6o2vs8ZnSQcbEDam9A8,730
36
+ moose_lib-0.5.23.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
37
+ moose_lib-0.5.23.dist-info/top_level.txt,sha256=XEns2-4aCmGp2XjJAeEH9TAUcGONLnSLy6ycT9FSJh8,16
38
+ moose_lib-0.5.23.dist-info/RECORD,,