orionis 0.510.0__py3-none-any.whl → 0.512.0__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.
Files changed (39) hide show
  1. orionis/console/base/scheduler_event_listener.py +136 -0
  2. orionis/console/commands/scheduler_work.py +37 -25
  3. orionis/console/contracts/event.py +3032 -9
  4. orionis/console/contracts/schedule.py +34 -0
  5. orionis/console/contracts/schedule_event_listener.py +324 -0
  6. orionis/console/entities/all_jobs_removed.py +23 -0
  7. orionis/console/entities/executor_added.py +23 -0
  8. orionis/console/entities/executor_removed.py +25 -0
  9. orionis/console/entities/job_added.py +24 -0
  10. orionis/console/entities/job_error.py +35 -0
  11. orionis/console/entities/job_event_data.py +40 -0
  12. orionis/console/entities/job_executed.py +31 -0
  13. orionis/console/entities/job_max_instances.py +27 -0
  14. orionis/console/entities/job_missed.py +25 -0
  15. orionis/console/entities/job_modified.py +23 -0
  16. orionis/console/entities/job_pause.py +22 -0
  17. orionis/console/entities/job_removed.py +22 -0
  18. orionis/console/entities/job_resume.py +25 -0
  19. orionis/console/entities/job_store_added.py +24 -0
  20. orionis/console/entities/job_store_removed.py +25 -0
  21. orionis/console/entities/job_submitted.py +24 -0
  22. orionis/console/entities/scheduler_event_data.py +33 -0
  23. orionis/console/entities/scheduler_paused.py +17 -0
  24. orionis/console/entities/scheduler_resumed.py +24 -0
  25. orionis/console/entities/scheduler_shutdown.py +23 -0
  26. orionis/console/entities/scheduler_started.py +21 -0
  27. orionis/console/enums/listener.py +75 -0
  28. orionis/console/tasks/event.py +3703 -21
  29. orionis/console/tasks/schedule.py +702 -48
  30. orionis/metadata/framework.py +1 -1
  31. {orionis-0.510.0.dist-info → orionis-0.512.0.dist-info}/METADATA +1 -1
  32. {orionis-0.510.0.dist-info → orionis-0.512.0.dist-info}/RECORD +36 -15
  33. orionis/console/contracts/listener.py +0 -132
  34. orionis/console/entities/listeners.py +0 -241
  35. orionis/console/tasks/exception_report.py +0 -94
  36. {orionis-0.510.0.dist-info → orionis-0.512.0.dist-info}/WHEEL +0 -0
  37. {orionis-0.510.0.dist-info → orionis-0.512.0.dist-info}/licenses/LICENCE +0 -0
  38. {orionis-0.510.0.dist-info → orionis-0.512.0.dist-info}/top_level.txt +0 -0
  39. {orionis-0.510.0.dist-info → orionis-0.512.0.dist-info}/zip-safe +0 -0
@@ -5,7 +5,7 @@
5
5
  NAME = "orionis"
6
6
 
7
7
  # Current version of the framework
8
- VERSION = "0.510.0"
8
+ VERSION = "0.512.0"
9
9
 
10
10
  # Full name of the author or maintainer of the project
11
11
  AUTHOR = "Raul Mauricio Uñate Castro"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: orionis
3
- Version: 0.510.0
3
+ Version: 0.512.0
4
4
  Summary: Orionis Framework – Elegant, Fast, and Powerful.
5
5
  Home-page: https://github.com/orionis-framework/framework
6
6
  Author: Raul Mauricio Uñate Castro
@@ -9,6 +9,7 @@ orionis/console/args/enums/actions.py,sha256=S3T-vWS6DJSGtANrq3od3-90iYAjPvJwaOZ
9
9
  orionis/console/base/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
10
10
  orionis/console/base/command.py,sha256=nasVPyKEvuv8sDFEWXhHyBCWAmSLfPPm2XlKaYYt_pM,6642
11
11
  orionis/console/base/scheduler.py,sha256=lUHd83YhpsojxcCDme2e9Gcw6ebnsdRFgny4MKH5-rc,3380
12
+ orionis/console/base/scheduler_event_listener.py,sha256=m3p55Zz7HrMxGU3S3oMaMG58YPSRXPJUVCh4Ky7GFR8,4062
12
13
  orionis/console/base/contracts/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
13
14
  orionis/console/base/contracts/command.py,sha256=vmAJD0yMQ5-AD_s9_xCFEAl64sKk65z7U2E196dALQM,5760
14
15
  orionis/console/base/contracts/scheduler.py,sha256=y8q4qv6oxjnWSt9G0HP2IjogtWIASfJaMO5vkG22U1Q,1184
@@ -17,16 +18,16 @@ orionis/console/commands/cache.py,sha256=8DsYoRzSBLn0P9qkGVItRbo0R6snWBDBg0_Xa7t
17
18
  orionis/console/commands/help.py,sha256=zfSw0pYaOnFN-_Ozdn4veBQDYMgSSDY10nPDCi-7tTY,3199
18
19
  orionis/console/commands/publisher.py,sha256=FUg-EUzK7LLXsla10ZUZro8V0Z5S-KjmsaSdRHSSGbA,21381
19
20
  orionis/console/commands/scheduler_list.py,sha256=OglphcIhdtWLkUccsINZt7AdWJtu9CE0awA7NkuXXvI,5179
20
- orionis/console/commands/scheduler_work.py,sha256=QcbVM2gpMV7jqNNpb6lXmDkEajjDso7s8qtjMZ70sOA,5068
21
+ orionis/console/commands/scheduler_work.py,sha256=JTB7mjA1KgJlE0yoWD6krhDPAu47tBZI01G00mTOReM,5930
21
22
  orionis/console/commands/test.py,sha256=-EmQwFwMBuby3OI9HwqMIwuJzd2CGbWbOqmwrR25sOE,2402
22
23
  orionis/console/commands/version.py,sha256=SUuNDJ40f2uq69OQUmPQXJKaa9Bm_iVRDPmBd7zc1Yc,3658
23
24
  orionis/console/commands/workflow.py,sha256=NYOmjTSvm2o6AE4h9LSTZMFSYPQreNmEJtronyOxaYk,2451
24
25
  orionis/console/contracts/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
25
- orionis/console/contracts/event.py,sha256=pxoxNjk31bt6yGvUFRTo_TI_SaZZar6iSIJARWR6KbM,5170
26
+ orionis/console/contracts/event.py,sha256=zaOkbRNKpU6U_cIEFic84C3WIcD8kCIyX9hc50jN8N0,119797
26
27
  orionis/console/contracts/kernel.py,sha256=mh4LlhEYHh3FuGZZQ0GBhD6ZLa5YQvaNj2r01IIHI5Y,826
27
- orionis/console/contracts/listener.py,sha256=tXp2kTVEaqLRWZC6BY8xqj3JP0xpDDx4btPy3wnr8cM,3251
28
28
  orionis/console/contracts/reactor.py,sha256=Xeq7Zrw6WE5MV_XOQfiQEchAFbb6-0TjLpjWOxYW--g,4554
29
- orionis/console/contracts/schedule.py,sha256=eGjcOH7kgdf0fWDZRfOFUQsIx4E8G38ayX5JwpkpN8E,4977
29
+ orionis/console/contracts/schedule.py,sha256=gMd_CS-W8d_pOX6dBjcqtYRL_rXzTWdzeg-WyrI2g7g,6260
30
+ orionis/console/contracts/schedule_event_listener.py,sha256=dD88szDWcTSrIkMrZOlhGXB-m0jXQtKYEUZk5rxvGXY,13004
30
31
  orionis/console/core/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
31
32
  orionis/console/core/reactor.py,sha256=3i7-jn_HBwYfsNR8xpExt5Owi3nk9BfHnW7J7lUmb-4,30414
32
33
  orionis/console/dumper/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
@@ -38,11 +39,32 @@ orionis/console/dynamic/progress_bar.py,sha256=iK1kAf9vJIgk6BbdlGvlJkGc1m7Ck4euN
38
39
  orionis/console/dynamic/contracts/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
39
40
  orionis/console/dynamic/contracts/progress_bar.py,sha256=NYebL2h-vg2t2H6IhJjuC37gglRkpT-MW71wbJtpLNg,1784
40
41
  orionis/console/entities/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
41
- orionis/console/entities/listeners.py,sha256=I5JbbnwKz-ZQhQgS2r1wqfUTwagg8Os6qzfEY8FzVzg,5345
42
+ orionis/console/entities/all_jobs_removed.py,sha256=4_Foo_CW2mP7iazBJX90I_QJ-Qd_wYGpaJGHXzYDREw,728
43
+ orionis/console/entities/executor_added.py,sha256=qtV8dQKYxI_NcpDdOObuCemQy0eAihr0yBIkXewGCv0,702
44
+ orionis/console/entities/executor_removed.py,sha256=B_Z_toclI46N5Wjo-ZUgFemxL_5UJcjkDod3kHWR1AQ,738
45
+ orionis/console/entities/job_added.py,sha256=pYxXxhU3bEitUV1m_Np6ypzDPcvfTaFBcKwi67hHt_c,813
46
+ orionis/console/entities/job_error.py,sha256=8BLyV_csom6MU3zcT7dzqfW4IjBv4BktDaVM-FsvJ5M,1231
47
+ orionis/console/entities/job_event_data.py,sha256=pyqeLyel31ZyQwEMW92wvpWNL0Nd753m8KEmZXz4UcU,1470
48
+ orionis/console/entities/job_executed.py,sha256=mrjL_-w-BJzri1E3Xbl2cnPl6e6Ynanm4SFDijaEGfE,1002
49
+ orionis/console/entities/job_max_instances.py,sha256=MwU4P9xhLBwUyhPGDLxXrbtmKZ5BQP-9go4RGiPHW0o,956
50
+ orionis/console/entities/job_missed.py,sha256=sIHLGBy9NEGlR339pm6nbT4y4d1NWlerH_vNE5S-AYE,848
51
+ orionis/console/entities/job_modified.py,sha256=BQen8qNbqp6Cvxx3GM_WK4gUxLqmWyYObimXkfq1Pjs,756
52
+ orionis/console/entities/job_pause.py,sha256=oLN28duhcu6Nm-wVhsTY458_3ucPc9G3Wogit3i16Pk,693
53
+ orionis/console/entities/job_removed.py,sha256=8Xp12158cmulyhgmprZ043RDtTz88w5hTlcgueb7-0k,705
54
+ orionis/console/entities/job_resume.py,sha256=IwCkjO5zrPU59hruF264EQYrPDoSEp_j4QrwORRgkhc,814
55
+ orionis/console/entities/job_store_added.py,sha256=NoocJD3zSm7E8ZsUob8BdvKxveu9WdEqAtVPCzC8WII,735
56
+ orionis/console/entities/job_store_removed.py,sha256=wh53sf3Rkezo5hMQkWo-NToeCYwMOmp7BLa1ACVUnqo,740
57
+ orionis/console/entities/job_submitted.py,sha256=8ftGEOsDQxHYK2tunGA9_b-u581hPcvNnZ5NmmaMua0,731
42
58
  orionis/console/entities/request.py,sha256=Sm-6jMd95teUEdh_4VJWjsDbvfID3khHCOU_2OEEIv4,980
59
+ orionis/console/entities/scheduler_event_data.py,sha256=lqHxY05ikHnv_WoGXpE1MDpVzWb48fYh7db-XgeLD9I,1114
60
+ orionis/console/entities/scheduler_paused.py,sha256=AQS44-abq6mJPZwriQZYpf1gKDZyJ7_N_UkpJqpfynM,656
61
+ orionis/console/entities/scheduler_resumed.py,sha256=pUONb_84dKqYk9CrR-6vkPm4BTFilmGDDH3ZzM-oZHE,805
62
+ orionis/console/entities/scheduler_shutdown.py,sha256=tyXDaIZqsHhQyK9v0zWwkBYW9AYWl5R8aY8ZY7oTr-0,862
63
+ orionis/console/entities/scheduler_started.py,sha256=kqSASUZQyKpOyRB8gfk4FpzFLwx6eWiOIB6N_eZKOqc,825
43
64
  orionis/console/enums/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
44
65
  orionis/console/enums/command.py,sha256=lCfVp2vnDojJN2gjdVxE_XU3mRjZZgOIxPfBVQYo9w4,1278
45
66
  orionis/console/enums/event.py,sha256=XRV7N14N5HHt-c0HqYhrbKv4n2P7ZOCcBT_3OAQzenU,1929
67
+ orionis/console/enums/listener.py,sha256=uii1CuAe6JPi6r3F-sEH_hVKl45HrWLm8l1PU1wX2Nk,2976
46
68
  orionis/console/exceptions/__init__.py,sha256=0qlHNuHMVZO87M-rP8lThUUyljRM1jSFNikaxSCjSbw,366
47
69
  orionis/console/exceptions/cli_exception.py,sha256=HsZ_vSeNiJWQ0gznVFNcIdhM0Bj_vkSRVBJs0wMjEKY,1141
48
70
  orionis/console/exceptions/cli_orionis_value_error.py,sha256=RQP0HRwxDG8hxFOT1kUoZ1Ab1CZ1KLoSIl5yqlmgG4M,1147
@@ -58,10 +80,9 @@ orionis/console/output/enums/__init__.py,sha256=LAaAxg-DpArCjf_jqZ0_9s3p8899gntD
58
80
  orionis/console/output/enums/styles.py,sha256=6a4oQCOBOKMh2ARdeq5GlIskJ3wjiylYmh66tUKKmpQ,4053
59
81
  orionis/console/request/cli_request.py,sha256=7-sgYmNUCipuHLVAwWLJiHv0cJCDmsM1Lu9s2D8RIII,1498
60
82
  orionis/console/tasks/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
61
- orionis/console/tasks/event.py,sha256=NcSmq3y4JWviXaSvRifmJs0nWqQQgHIDmzlWELrLeNU,12204
62
- orionis/console/tasks/exception_report.py,sha256=IN1PCQ08ZHs1sivUpzi2f9U9eW8ydZyb8GO6KiT56LY,3643
83
+ orionis/console/tasks/event.py,sha256=UhAIbSHueyykzny8SorxKbo8S-_TxP6jLhT-FuFyLL0,163405
63
84
  orionis/console/tasks/listener.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
64
- orionis/console/tasks/schedule.py,sha256=eF02JnKNBXeYFn4NlSrc8HhrgRlnBidXY1n2UxcOeBU,20240
85
+ orionis/console/tasks/schedule.py,sha256=1VOLwLxmnlFx7CehWPOgSBAxnoBkmCwkRYsGo9NgGvM,47138
65
86
  orionis/container/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
66
87
  orionis/container/container.py,sha256=aF_b6lTUpG4YCo9yFJEzsntTdIzgMMXFW5LyWqAJVBQ,87987
67
88
  orionis/container/context/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
@@ -219,7 +240,7 @@ orionis/foundation/providers/scheduler_provider.py,sha256=72SoixFog9IOE9Ve9Xcfw6
219
240
  orionis/foundation/providers/testing_provider.py,sha256=SrJRpdvcblx9WvX7x9Y3zc7OQfiTf7la0HAJrm2ESlE,3725
220
241
  orionis/foundation/providers/workers_provider.py,sha256=oa_2NIDH6UxZrtuGkkoo_zEoNIMGgJ46vg5CCgAm7wI,3926
221
242
  orionis/metadata/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
222
- orionis/metadata/framework.py,sha256=QZA4fgvDUzJFr_KWMHvd4q3iYcuk7GhWvnvxKGIYJfs,4109
243
+ orionis/metadata/framework.py,sha256=odvj4VtrkvwqfB9sDAmuu7FEiT6n79mgB5NQb05ME2A,4109
223
244
  orionis/metadata/package.py,sha256=k7Yriyp5aUcR-iR8SK2ec_lf0_Cyc-C7JczgXa-I67w,16039
224
245
  orionis/services/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
225
246
  orionis/services/asynchrony/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
@@ -395,7 +416,7 @@ orionis/test/validators/web_report.py,sha256=n9BfzOZz6aEiNTypXcwuWbFRG0OdHNSmCNu
395
416
  orionis/test/validators/workers.py,sha256=rWcdRexINNEmGaO7mnc1MKUxkHKxrTsVuHgbnIfJYgc,1206
396
417
  orionis/test/view/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
397
418
  orionis/test/view/render.py,sha256=f-zNhtKSg9R5Njqujbg2l2amAs2-mRVESneLIkWOZjU,4082
398
- orionis-0.510.0.dist-info/licenses/LICENCE,sha256=JhC-z_9mbpUrCfPjcl3DhDA8trNDMzb57cvRSam1avc,1463
419
+ orionis-0.512.0.dist-info/licenses/LICENCE,sha256=JhC-z_9mbpUrCfPjcl3DhDA8trNDMzb57cvRSam1avc,1463
399
420
  tests/container/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
400
421
  tests/container/context/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
401
422
  tests/container/context/test_manager.py,sha256=wOwXpl9rHNfTTexa9GBKYMwK0_-KSQPbI-AEyGNkmAE,1356
@@ -541,8 +562,8 @@ tests/testing/validators/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZ
541
562
  tests/testing/validators/test_testing_validators.py,sha256=WPo5GxTP6xE-Dw3X1vZoqOMpb6HhokjNSbgDsDRDvy4,16588
542
563
  tests/testing/view/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
543
564
  tests/testing/view/test_render.py,sha256=tnnMBwS0iKUIbogLvu-7Rii50G6Koddp3XT4wgdFEYM,1050
544
- orionis-0.510.0.dist-info/METADATA,sha256=n5Ko5KXmKJgRv_A_OTor2EH4h8uKOhpAJT_C_RWRDLQ,4801
545
- orionis-0.510.0.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
546
- orionis-0.510.0.dist-info/top_level.txt,sha256=2bdoHgyGZhOtLAXS6Om8OCTmL24dUMC_L1quMe_ETbk,14
547
- orionis-0.510.0.dist-info/zip-safe,sha256=frcCV1k9oG9oKj3dpUqdJg1PxRT2RSN_XKdLCPjaYaY,2
548
- orionis-0.510.0.dist-info/RECORD,,
565
+ orionis-0.512.0.dist-info/METADATA,sha256=dkTy4zSWuTdWAIJ0UYihCTdOnHJyS7B9rf5sarLqOnA,4801
566
+ orionis-0.512.0.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
567
+ orionis-0.512.0.dist-info/top_level.txt,sha256=2bdoHgyGZhOtLAXS6Om8OCTmL24dUMC_L1quMe_ETbk,14
568
+ orionis-0.512.0.dist-info/zip-safe,sha256=frcCV1k9oG9oKj3dpUqdJg1PxRT2RSN_XKdLCPjaYaY,2
569
+ orionis-0.512.0.dist-info/RECORD,,
@@ -1,132 +0,0 @@
1
- from abc import ABC, abstractmethod
2
-
3
- class IEventListener(ABC):
4
- """
5
- Interface for event listeners that handle various stages of event processing.
6
- """
7
-
8
- @abstractmethod
9
- def before(self, event):
10
- """
11
- Hook method called before the main event handling logic.
12
-
13
- Parameters
14
- ----------
15
- event : object
16
- The event object that is about to be processed.
17
-
18
- Returns
19
- -------
20
- None
21
- This method does not return anything.
22
-
23
- Notes
24
- -----
25
- Override this method to implement logic that should run before the event is handled.
26
- """
27
- pass
28
-
29
- @abstractmethod
30
- def after(self, event):
31
- """
32
- Hook method called after an event is processed.
33
-
34
- Parameters
35
- ----------
36
- event : object
37
- The event object that was processed.
38
-
39
- Returns
40
- -------
41
- None
42
- This method does not return anything.
43
-
44
- Notes
45
- -----
46
- Override this method to implement logic that should run after the event is handled.
47
- """
48
- pass
49
-
50
- @abstractmethod
51
- def onSuccess(self, event):
52
- """
53
- Handle actions to be performed when an event is successfully processed.
54
-
55
- Parameters
56
- ----------
57
- event : object
58
- The event object that triggered the success callback.
59
-
60
- Returns
61
- -------
62
- None
63
- This method does not return anything.
64
-
65
- Notes
66
- -----
67
- Override this method to define actions on successful event processing.
68
- """
69
- pass
70
-
71
- @abstractmethod
72
- def onFailure(self, event):
73
- """
74
- Handle the event when a failure occurs during event processing.
75
-
76
- Parameters
77
- ----------
78
- event : object
79
- The event object containing information about the failure.
80
-
81
- Returns
82
- -------
83
- None
84
- This method does not return anything.
85
-
86
- Notes
87
- -----
88
- Override this method to define actions when event processing fails.
89
- """
90
- pass
91
-
92
- @abstractmethod
93
- def onMissed(self, event):
94
- """
95
- Handle the event when an expected event is missed.
96
-
97
- Parameters
98
- ----------
99
- event : object
100
- The event object that was missed.
101
-
102
- Returns
103
- -------
104
- None
105
- This method does not return anything.
106
-
107
- Notes
108
- -----
109
- Override this method to define actions when an event is missed.
110
- """
111
- pass
112
-
113
- @abstractmethod
114
- def onMaxInstances(self, event):
115
- """
116
- Handles the event triggered when the maximum number of instances is reached.
117
-
118
- Parameters
119
- ----------
120
- event : object
121
- The event object containing information about the max instances event.
122
-
123
- Returns
124
- -------
125
- None
126
- This method does not return anything.
127
-
128
- Notes
129
- -----
130
- Override this method to define actions when the maximum number of instances is reached.
131
- """
132
- pass
@@ -1,241 +0,0 @@
1
- from dataclasses import dataclass
2
- from datetime import datetime
3
- from typing import Any
4
-
5
- # ==============================================================
6
- # Base Events
7
- # ==============================================================
8
-
9
- @dataclass
10
- class SchedulerEventData:
11
- """
12
- Base class for scheduler-related events.
13
-
14
- Attributes
15
- ----------
16
- code : int
17
- The numeric event code indicating the event type.
18
- """
19
- code: int
20
-
21
-
22
- @dataclass
23
- class JobEventData(SchedulerEventData):
24
- """
25
- Base class for job-related events.
26
-
27
- Attributes
28
- ----------
29
- code : int
30
- The numeric event code indicating the event type.
31
- job_id : str
32
- The identifier of the job.
33
- jobstore : str
34
- The name of the job store where the job is located.
35
- """
36
- job_id: str
37
- jobstore: str
38
-
39
-
40
- # ==============================================================
41
- # Scheduler Lifecycle Events
42
- # ==============================================================
43
-
44
- @dataclass
45
- class SchedulerStarted(SchedulerEventData):
46
- """
47
- Event triggered when the scheduler starts running.
48
- """
49
-
50
-
51
- @dataclass
52
- class SchedulerShutdown(SchedulerEventData):
53
- """
54
- Event triggered when the scheduler shuts down.
55
- """
56
-
57
-
58
- @dataclass
59
- class SchedulerPaused(SchedulerEventData):
60
- """
61
- Event triggered when the scheduler is paused.
62
- """
63
-
64
-
65
- @dataclass
66
- class SchedulerResumed(SchedulerEventData):
67
- """
68
- Event triggered when the scheduler is resumed.
69
- """
70
-
71
-
72
- # ==============================================================
73
- # Executor and JobStore Events
74
- # ==============================================================
75
-
76
- @dataclass
77
- class ExecutorAdded(SchedulerEventData):
78
- """
79
- Event triggered when an executor is added.
80
-
81
- Attributes
82
- ----------
83
- alias : str
84
- The alias of the added executor.
85
- """
86
- alias: str
87
-
88
-
89
- @dataclass
90
- class ExecutorRemoved(SchedulerEventData):
91
- """
92
- Event triggered when an executor is removed.
93
-
94
- Attributes
95
- ----------
96
- alias : str
97
- The alias of the removed executor.
98
- """
99
- alias: str
100
-
101
-
102
- @dataclass
103
- class JobstoreAdded(SchedulerEventData):
104
- """
105
- Event triggered when a job store is added.
106
-
107
- Attributes
108
- ----------
109
- alias : str
110
- The alias of the added job store.
111
- """
112
- alias: str
113
-
114
-
115
- @dataclass
116
- class JobstoreRemoved(SchedulerEventData):
117
- """
118
- Event triggered when a job store is removed.
119
-
120
- Attributes
121
- ----------
122
- alias : str
123
- The alias of the removed job store.
124
- """
125
- alias: str
126
-
127
-
128
- @dataclass
129
- class AllJobsRemoved(SchedulerEventData):
130
- """
131
- Event triggered when all jobs are removed from a job store.
132
-
133
- Attributes
134
- ----------
135
- jobstore : str
136
- The alias of the job store from which jobs were removed.
137
- """
138
- jobstore: str
139
-
140
-
141
- # ==============================================================
142
- # Job Management Events
143
- # ==============================================================
144
-
145
- @dataclass
146
- class JobAdded(JobEventData):
147
- """
148
- Event triggered when a job is added to a job store.
149
- """
150
-
151
-
152
- @dataclass
153
- class JobRemoved(JobEventData):
154
- """
155
- Event triggered when a job is removed from a job store.
156
- """
157
-
158
-
159
- @dataclass
160
- class JobModified(JobEventData):
161
- """
162
- Event triggered when a job is modified in a job store.
163
- """
164
-
165
-
166
- @dataclass
167
- class JobSubmitted(JobEventData):
168
- """
169
- Event triggered when a job is submitted to an executor.
170
-
171
- Attributes
172
- ----------
173
- run_time : datetime
174
- The datetime when the job was scheduled to run.
175
- """
176
- run_time: datetime
177
-
178
-
179
- @dataclass
180
- class JobMaxInstances(JobEventData):
181
- """
182
- Event triggered when a job exceeds its maximum allowed instances.
183
-
184
- Attributes
185
- ----------
186
- run_time : datetime
187
- The datetime when the job was scheduled to run.
188
- """
189
- run_time: datetime
190
-
191
-
192
- # ==============================================================
193
- # Job Execution Events
194
- # ==============================================================
195
-
196
- @dataclass
197
- class JobExecuted(JobEventData):
198
- """
199
- Event triggered when a job finishes successfully.
200
-
201
- Attributes
202
- ----------
203
- scheduled_run_time : datetime
204
- The datetime when the job was scheduled to run.
205
- retval : Any
206
- The return value of the job function.
207
- """
208
- scheduled_run_time: datetime
209
- retval: Any
210
-
211
-
212
- @dataclass
213
- class JobError(JobEventData):
214
- """
215
- Event triggered when a job raises an exception during execution.
216
-
217
- Attributes
218
- ----------
219
- scheduled_run_time : datetime
220
- The datetime when the job was scheduled to run.
221
- exception : Exception
222
- The exception raised by the job.
223
- traceback : str
224
- The traceback of the exception.
225
- """
226
- scheduled_run_time: datetime
227
- exception: Exception
228
- traceback: str
229
-
230
-
231
- @dataclass
232
- class JobMissed(JobEventData):
233
- """
234
- Event triggered when a job run is missed due to scheduler constraints.
235
-
236
- Attributes
237
- ----------
238
- scheduled_run_time : datetime
239
- The datetime when the job was originally scheduled to run.
240
- """
241
- scheduled_run_time: datetime
@@ -1,94 +0,0 @@
1
- from rich.console import Console
2
- from rich.panel import Panel
3
- from rich.text import Text
4
- from rich.traceback import Traceback
5
-
6
- class ScheduleErrorReporter:
7
- """Handles and displays errors and warnings with rich formatting using the Rich library.
8
-
9
- This class provides methods to output formatted error and warning messages to the console,
10
- enhancing readability and debugging using the Rich library's features.
11
-
12
- Attributes
13
- ----------
14
- console : Console
15
- Rich Console object used for rendering formatted output to the terminal.
16
- """
17
-
18
- def __init__(self):
19
- """
20
- Initialize the ErrorReporter instance.
21
-
22
- This constructor creates a new Console object from the Rich library and assigns it to the 'console' attribute,
23
- which is used for rendering formatted output to the terminal.
24
-
25
- Returns
26
- -------
27
- None
28
- This constructor does not return any value.
29
- """
30
- self.console = Console()
31
-
32
- def reportException(self, job_id: str, exception: Exception, traceback: str = None):
33
- """
34
- Display a formatted error message for an exception that occurred during a job execution.
35
-
36
- This method prints a visually enhanced error panel to the console, including the job identifier and the exception message.
37
- If a traceback string is provided, it is rendered below the error panel for detailed debugging information.
38
-
39
- Parameters
40
- ----------
41
- job_id : str
42
- The identifier of the job where the exception occurred.
43
- exception : Exception
44
- The exception instance that was raised.
45
- traceback : str, optional
46
- The string representation of the traceback. If provided, it will be displayed after the error message.
47
-
48
- Returns
49
- -------
50
- None
51
- This method does not return any value. It outputs formatted error information to the console.
52
- """
53
- title = f"[bold red]Job Execution Error[/bold red]"
54
- message = Text.assemble(
55
- ("An exception occurred during the execution of job ", "white"),
56
- (f"'{job_id}'", "bold cyan"),
57
- (":\n", "white"),
58
- (f"{type(exception).__name__}: {exception}", "red")
59
- )
60
-
61
- self.console.print(Panel(message, title=title, border_style="red", padding=(1, 2)))
62
- if traceback:
63
- tb = Traceback.from_string(traceback)
64
- self.console.print(tb)
65
- self.console.line()
66
-
67
-
68
- def reportMissed(self, job_id: str, scheduled_time):
69
- """
70
- Display a formatted warning message for a missed job execution.
71
-
72
- This method prints a warning panel to the console, indicating that a scheduled job was missed and showing its scheduled time.
73
-
74
- Parameters
75
- ----------
76
- job_id : str
77
- The identifier of the missed job.
78
- scheduled_time : Any
79
- The time the job was scheduled to run.
80
-
81
- Returns
82
- -------
83
- None
84
- This method does not return any value. It outputs a warning message to the console.
85
- """
86
- title = f"[bold yellow]Missed Scheduled Job[/bold yellow]"
87
- msg = Text.assemble(
88
- ("The scheduled job ", "white"),
89
- (f"'{job_id}'", "bold cyan"),
90
- (" was not executed as planned.\nScheduled time: ", "white"),
91
- (f"{scheduled_time}", "bold green")
92
- )
93
- self.console.print(Panel(msg, title=title, border_style="yellow", padding=(1, 2)))
94
- self.console.line()