orionis 0.511.0__py3-none-any.whl → 0.513.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 (47) hide show
  1. orionis/console/base/command.py +1 -1
  2. orionis/console/base/scheduler.py +1 -1
  3. orionis/console/base/scheduler_event_listener.py +136 -0
  4. orionis/console/commands/scheduler_work.py +37 -25
  5. orionis/console/contracts/event.py +3032 -9
  6. orionis/console/contracts/schedule.py +34 -0
  7. orionis/console/contracts/schedule_event_listener.py +320 -0
  8. orionis/console/contracts/scheduler.py +140 -0
  9. orionis/console/core/reactor.py +1 -1
  10. orionis/console/entities/all_jobs_removed.py +23 -0
  11. orionis/console/entities/executor_added.py +23 -0
  12. orionis/console/entities/executor_removed.py +25 -0
  13. orionis/console/entities/job_added.py +24 -0
  14. orionis/console/entities/job_error.py +35 -0
  15. orionis/console/entities/job_event_data.py +40 -0
  16. orionis/console/entities/job_executed.py +31 -0
  17. orionis/console/entities/job_max_instances.py +27 -0
  18. orionis/console/entities/job_missed.py +25 -0
  19. orionis/console/entities/job_modified.py +23 -0
  20. orionis/console/entities/job_pause.py +22 -0
  21. orionis/console/entities/job_removed.py +22 -0
  22. orionis/console/entities/job_resume.py +25 -0
  23. orionis/console/entities/job_store_added.py +24 -0
  24. orionis/console/entities/job_store_removed.py +25 -0
  25. orionis/console/entities/job_submitted.py +24 -0
  26. orionis/console/entities/scheduler_event_data.py +33 -0
  27. orionis/console/entities/scheduler_paused.py +17 -0
  28. orionis/console/entities/scheduler_resumed.py +24 -0
  29. orionis/console/entities/scheduler_shutdown.py +23 -0
  30. orionis/console/entities/scheduler_started.py +21 -0
  31. orionis/console/enums/listener.py +75 -0
  32. orionis/console/tasks/event.py +3703 -21
  33. orionis/console/tasks/schedule.py +701 -52
  34. orionis/foundation/application.py +1 -1
  35. orionis/metadata/framework.py +1 -1
  36. {orionis-0.511.0.dist-info → orionis-0.513.0.dist-info}/METADATA +1 -1
  37. {orionis-0.511.0.dist-info → orionis-0.513.0.dist-info}/RECORD +42 -22
  38. orionis/console/base/contracts/__init__.py +0 -0
  39. orionis/console/base/contracts/scheduler.py +0 -38
  40. orionis/console/contracts/listener.py +0 -132
  41. orionis/console/entities/listeners.py +0 -241
  42. orionis/console/tasks/exception_report.py +0 -94
  43. /orionis/console/{base/contracts → contracts}/command.py +0 -0
  44. {orionis-0.511.0.dist-info → orionis-0.513.0.dist-info}/WHEEL +0 -0
  45. {orionis-0.511.0.dist-info → orionis-0.513.0.dist-info}/licenses/LICENCE +0 -0
  46. {orionis-0.511.0.dist-info → orionis-0.513.0.dist-info}/top_level.txt +0 -0
  47. {orionis-0.511.0.dist-info → orionis-0.513.0.dist-info}/zip-safe +0 -0
@@ -4,6 +4,40 @@ from orionis.console.tasks.event import Event
4
4
 
5
5
  class ISchedule(ABC):
6
6
 
7
+ @abstractmethod
8
+ def _setListener(
9
+ self,
10
+ event: str,
11
+ listener: callable
12
+ ) -> None:
13
+ """
14
+ Register a listener callback for a specific scheduler event.
15
+
16
+ This method allows the registration of a callable listener function that will be
17
+ invoked when the specified scheduler event occurs. The event can be one of the
18
+ predefined global events or a specific job ID. The listener must be a callable
19
+ function that accepts a single argument, which will be the event object.
20
+
21
+ Parameters
22
+ ----------
23
+ event : str
24
+ The name of the event to listen for. This can be a global event name (e.g., 'scheduler_started')
25
+ or a specific job ID.
26
+ listener : callable
27
+ A callable function that will be invoked when the specified event occurs.
28
+ The function should accept one parameter, which will be the event object.
29
+
30
+ Returns
31
+ -------
32
+ None
33
+ This method does not return any value. It registers the listener for the specified event.
34
+
35
+ Raises
36
+ ------
37
+ ValueError
38
+ If the event name is not a non-empty string or if the listener is not callable.
39
+ """
40
+
7
41
  @abstractmethod
8
42
  def command(
9
43
  self,
@@ -0,0 +1,320 @@
1
+ from abc import ABC, abstractmethod
2
+ from orionis.console.entities.job_error import JobError
3
+ from orionis.console.entities.job_executed import JobExecuted
4
+ from orionis.console.entities.job_max_instances import JobMaxInstances
5
+ from orionis.console.entities.job_missed import JobMissed
6
+ from orionis.console.entities.job_pause import JobPause
7
+ from orionis.console.entities.job_removed import JobRemoved
8
+ from orionis.console.entities.job_resume import JobResume
9
+ from orionis.console.entities.job_submitted import JobSubmitted
10
+
11
+ class IScheduleEventListener(ABC):
12
+ """
13
+ Interface for event listeners that handle various stages of event processing.
14
+ """
15
+
16
+ @abstractmethod
17
+ async def before(self, event: JobSubmitted, schedule):
18
+ """
19
+ Hook method called before the main event handling logic.
20
+
21
+ This method is invoked prior to processing the event, allowing for any
22
+ pre-processing or setup tasks to be performed. It can be overridden to
23
+ implement custom logic that should execute before the event is handled.
24
+
25
+ Parameters
26
+ ----------
27
+ event : JobSubmitted
28
+ The event object that is about to be processed. This contains
29
+ information about the job submission.
30
+ schedule : ISchedule
31
+ The schedule object associated with the event. This provides
32
+ context about the scheduling system.
33
+
34
+ Returns
35
+ -------
36
+ None
37
+ This method does not return any value.
38
+
39
+ Notes
40
+ -----
41
+ Override this method to define actions or checks that should occur
42
+ before the event is processed.
43
+ """
44
+
45
+ # This is an abstract method, so it does not contain any implementation.
46
+ # Subclasses must override this method to provide specific behavior.
47
+ pass
48
+
49
+ @abstractmethod
50
+ async def after(self, event: JobExecuted, schedule):
51
+ """
52
+ Hook method called after an event is processed.
53
+
54
+ This method is invoked once the event processing is complete, allowing
55
+ for any post-processing or cleanup tasks to be performed. It can be
56
+ overridden to implement custom logic that should execute after the
57
+ event is handled.
58
+
59
+ Parameters
60
+ ----------
61
+ event : JobExecuted
62
+ The event object that was processed. This contains information
63
+ about the job execution, such as its status and metadata.
64
+ schedule : ISchedule
65
+ The schedule object associated with the event. This provides
66
+ context about the scheduling system and its state.
67
+
68
+ Returns
69
+ -------
70
+ None
71
+ This method does not return any value.
72
+
73
+ Notes
74
+ -----
75
+ Override this method to define actions or checks that should occur
76
+ after the event is processed, such as logging, resource cleanup, or
77
+ triggering subsequent tasks.
78
+ """
79
+
80
+ # This is an abstract method, so it does not contain any implementation.
81
+ # Subclasses must override this method to provide specific behavior.
82
+ pass
83
+
84
+ @abstractmethod
85
+ async def onSuccess(self, event: JobExecuted, schedule):
86
+ """
87
+ Handle actions to be performed when an event is successfully processed.
88
+
89
+ This method is invoked after an event is processed successfully, allowing
90
+ for any follow-up actions, such as logging, notifications, or triggering
91
+ dependent tasks. Subclasses should override this method to define custom
92
+ behavior for handling successful event processing.
93
+
94
+ Parameters
95
+ ----------
96
+ event : JobExecuted
97
+ The event object containing details about the successfully executed job,
98
+ such as its status, metadata, and execution results.
99
+ schedule : ISchedule
100
+ The schedule object associated with the event, providing context about
101
+ the scheduling system and its state.
102
+
103
+ Returns
104
+ -------
105
+ None
106
+ This method does not return any value.
107
+
108
+ Notes
109
+ -----
110
+ Override this method to implement specific actions or checks that should
111
+ occur after an event is successfully processed.
112
+ """
113
+
114
+ # This is an abstract method, so it does not contain any implementation.
115
+ # Subclasses must override this method to provide specific behavior.
116
+ pass
117
+
118
+ @abstractmethod
119
+ async def onFailure(self, event: JobError, schedule):
120
+ """
121
+ Handle the event when a failure occurs during event processing.
122
+
123
+ This method is invoked whenever an error or failure occurs during the
124
+ processing of an event. It allows for custom error handling logic to be
125
+ implemented, such as logging the error, notifying relevant parties, or
126
+ performing cleanup tasks. Subclasses should override this method to
127
+ define specific actions to take in response to failures.
128
+
129
+ Parameters
130
+ ----------
131
+ event : JobError
132
+ The event object containing detailed information about the failure,
133
+ including the error message, stack trace, and any relevant metadata.
134
+ schedule : ISchedule
135
+ The schedule object associated with the event, providing context
136
+ about the scheduling system and its state at the time of the failure.
137
+
138
+ Returns
139
+ -------
140
+ None
141
+ This method does not return any value. It is intended for handling
142
+ side effects or performing actions in response to the failure.
143
+
144
+ Notes
145
+ -----
146
+ Override this method to implement specific error handling logic that
147
+ aligns with the application's requirements.
148
+ """
149
+
150
+ # This is an abstract method, so it does not contain any implementation.
151
+ # Subclasses must override this method to provide specific behavior.
152
+ pass
153
+
154
+ @abstractmethod
155
+ async def onMissed(self, event: JobMissed, schedule):
156
+ """
157
+ Handle the event triggered when an expected job execution is missed.
158
+
159
+ This method is invoked whenever a scheduled job is missed, allowing for
160
+ custom handling logic to be implemented. Subclasses should override this
161
+ method to define specific actions to take in response to missed events,
162
+ such as logging, notifications, or corrective measures.
163
+
164
+ Parameters
165
+ ----------
166
+ event : JobMissed
167
+ The event object containing details about the missed job, including
168
+ its metadata and the reason it was missed.
169
+ schedule : ISchedule
170
+ The schedule object associated with the event, providing context
171
+ about the scheduling system and its state at the time of the missed event.
172
+
173
+ Returns
174
+ -------
175
+ None
176
+ This method does not return any value. It is intended for handling
177
+ side effects or performing actions in response to the missed event.
178
+
179
+ Notes
180
+ -----
181
+ Override this method to implement specific logic that aligns with the
182
+ application's requirements for handling missed job executions.
183
+ """
184
+
185
+ # Abstract method: Subclasses must provide an implementation for this.
186
+ pass
187
+
188
+ @abstractmethod
189
+ async def onMaxInstances(self, event: JobMaxInstances, schedule):
190
+ """
191
+ Handle the event triggered when a job exceeds the maximum allowed instances.
192
+
193
+ This method is invoked whenever a job attempts to run but is blocked
194
+ because it has reached its maximum number of concurrent instances.
195
+ Subclasses should override this method to define specific actions to
196
+ take in response to this event, such as logging, notifications, or
197
+ implementing backoff strategies.
198
+
199
+ Parameters
200
+ ----------
201
+ event : JobMaxInstances
202
+ The event object containing details about the job that exceeded
203
+ its maximum instances, including its metadata and the configured limit.
204
+ schedule : ISchedule
205
+ The schedule object associated with the event, providing context
206
+ about the scheduling system and its state at the time of the event.
207
+
208
+ Returns
209
+ -------
210
+ None
211
+ This method does not return any value. It is intended for handling
212
+ side effects or performing actions in response to the max instances event.
213
+
214
+ Notes
215
+ -----
216
+ Override this method to implement specific logic that aligns with the
217
+ application's requirements for handling jobs that exceed their maximum instances.
218
+ """
219
+
220
+ # Abstract method: Subclasses must provide an implementation for this.
221
+ pass
222
+
223
+ @abstractmethod
224
+ async def onPaused(self, event: JobPause, schedule):
225
+ """
226
+ Handle the event triggered when the scheduler is paused.
227
+
228
+ This method is invoked whenever the scheduler is paused, allowing for
229
+ custom handling logic to be implemented. Subclasses should override this
230
+ method to define specific actions to take in response to the pause event,
231
+ such as logging, notifications, or resource management.
232
+
233
+ Parameters
234
+ ----------
235
+ event : JobPause
236
+ The event object containing details about the pause event.
237
+ schedule : ISchedule
238
+ The schedule object associated with the event, providing context
239
+ about the scheduling system and its state at the time of the pause event.
240
+
241
+ Returns
242
+ -------
243
+ None
244
+ This method does not return any value. It is intended for handling
245
+ side effects or performing actions in response to the pause event.
246
+
247
+ Notes
248
+ -----
249
+ Override this method to implement specific logic that aligns with the
250
+ application's requirements for handling scheduler pause events.
251
+ """
252
+
253
+ # Abstract method: Subclasses must provide an implementation for this.
254
+ pass
255
+
256
+ @abstractmethod
257
+ async def onResumed(self, event: JobResume, schedule):
258
+ """
259
+ Handle the event triggered when the scheduler is resumed.
260
+
261
+ This method is invoked whenever the scheduler is resumed, allowing for
262
+ custom handling logic to be implemented. Subclasses should override this
263
+ method to define specific actions to take in response to the resume event,
264
+ such as logging, notifications, or resource management.
265
+
266
+ Parameters
267
+ ----------
268
+ event : JobResume
269
+ The event object containing details about the resume event.
270
+ schedule : ISchedule
271
+ The schedule object associated with the event, providing context
272
+ about the scheduling system and its state at the time of the resume event.
273
+
274
+ Returns
275
+ -------
276
+ None
277
+ This method does not return any value. It is intended for handling
278
+ side effects or performing actions in response to the resume event.
279
+
280
+ Notes
281
+ -----
282
+ Override this method to implement specific logic that aligns with the
283
+ application's requirements for handling scheduler resume events.
284
+ """
285
+
286
+ # Abstract method: Subclasses must provide an implementation for this.
287
+ pass
288
+
289
+ @abstractmethod
290
+ async def onRemoved(self, event: JobRemoved, schedule):
291
+ """
292
+ Handle the event triggered when a job is removed from the scheduler.
293
+
294
+ This method is invoked whenever a job is removed, allowing for custom
295
+ handling logic to be implemented. Subclasses should override this method
296
+ to define specific actions to take in response to the job removal event,
297
+ such as logging, notifications, or resource cleanup.
298
+
299
+ Parameters
300
+ ----------
301
+ event : JobRemoved
302
+ The event object containing details about the removed job.
303
+ schedule : ISchedule
304
+ The schedule object associated with the event, providing context
305
+ about the scheduling system and its state at the time of the job removal.
306
+
307
+ Returns
308
+ -------
309
+ None
310
+ This method does not return any value. It is intended for handling
311
+ side effects or performing actions in response to the job removal event.
312
+
313
+ Notes
314
+ -----
315
+ Override this method to implement specific logic that aligns with the
316
+ application's requirements for handling job removal events.
317
+ """
318
+
319
+ # Abstract method: Subclasses must provide an implementation for this.
320
+ pass
@@ -0,0 +1,140 @@
1
+ from abc import ABC, abstractmethod
2
+ from datetime import datetime
3
+ from orionis.console.contracts.schedule import ISchedule
4
+
5
+ class IBaseScheduler(ABC):
6
+
7
+ # Pause Global Scheduler at a specific time
8
+ PAUSE_AT: datetime = None
9
+
10
+ # Resume Global Scheduler at a specific time
11
+ RESUME_AT: datetime = None
12
+
13
+ # Finalize Global Scheduler at a specific time
14
+ FINALIZE_AT: datetime = None
15
+
16
+ @abstractmethod
17
+ def tasks(self, schedule: ISchedule):
18
+ """
19
+ Defines and registers scheduled tasks for the application.
20
+
21
+ Parameters
22
+ ----------
23
+ schedule : ISchedule
24
+ The schedule object used to define and register scheduled commands.
25
+ This object provides methods to add tasks to the scheduler.
26
+
27
+ Returns
28
+ -------
29
+ None
30
+ This method does not return any value. It is intended to be overridden
31
+ by subclasses to specify scheduled tasks.
32
+
33
+ Notes
34
+ -----
35
+ This method serves as a contract for subclasses to implement task registration
36
+ logic. Subclasses should use the provided `schedule` object to define and
37
+ register tasks that the scheduler will execute.
38
+ """
39
+ # Abstract method to be implemented by subclasses for task registration
40
+ pass
41
+
42
+ @abstractmethod
43
+ def onStarted(self):
44
+ """
45
+ Called when the scheduler is started.
46
+
47
+ Returns
48
+ -------
49
+ None
50
+ This method does not return any value.
51
+
52
+ Notes
53
+ -----
54
+ Subclasses should override this method to implement custom behavior that
55
+ should occur when the scheduler starts running. This can include initializing
56
+ resources or logging the start event.
57
+ """
58
+ # Abstract method to define behavior when the scheduler starts
59
+ pass
60
+
61
+ @abstractmethod
62
+ def onPaused(self):
63
+ """
64
+ Called when the scheduler is paused.
65
+
66
+ Returns
67
+ -------
68
+ None
69
+ This method does not return any value.
70
+
71
+ Notes
72
+ -----
73
+ Subclasses should override this method to define custom behavior that occurs
74
+ when the scheduler enters a paused state. This can include saving the current
75
+ state or logging the pause event.
76
+ """
77
+ # Abstract method to define behavior when the scheduler is paused
78
+ pass
79
+
80
+ @abstractmethod
81
+ def onResumed(self):
82
+ """
83
+ Called when the scheduler is resumed from a paused state.
84
+
85
+ Returns
86
+ -------
87
+ None
88
+ This method does not return any value.
89
+
90
+ Notes
91
+ -----
92
+ Subclasses should override this method to implement any actions that need to
93
+ occur when the scheduler resumes operation. This can include restoring the
94
+ state or logging the resume event.
95
+ """
96
+ # Abstract method to define behavior when the scheduler is resumed
97
+ pass
98
+
99
+ @abstractmethod
100
+ def onFinalized(self):
101
+ """
102
+ Called when the scheduler has completed its execution and is being finalized.
103
+
104
+ Returns
105
+ -------
106
+ None
107
+ This method does not return any value.
108
+
109
+ Notes
110
+ -----
111
+ Subclasses can override this method to perform any necessary cleanup or
112
+ finalization tasks, such as releasing resources or logging the finalization
113
+ event.
114
+ """
115
+ # Abstract method to define behavior when the scheduler is finalized
116
+ pass
117
+
118
+ @abstractmethod
119
+ def onError(self, error: Exception):
120
+ """
121
+ Handles errors that occur within the scheduler.
122
+
123
+ Parameters
124
+ ----------
125
+ error : Exception
126
+ The exception instance representing the error that occurred.
127
+
128
+ Returns
129
+ -------
130
+ None
131
+ This method does not return any value.
132
+
133
+ Notes
134
+ -----
135
+ Subclasses can override this method to implement custom error handling logic
136
+ for the scheduler. This can include logging the error, notifying stakeholders,
137
+ or attempting to recover from the error.
138
+ """
139
+ # Abstract method to define behavior for handling errors in the scheduler
140
+ pass
@@ -4,7 +4,7 @@ import re
4
4
  from typing import Any, List, Optional
5
5
  from orionis.console.args.argument import CLIArgument
6
6
  from orionis.console.base.command import BaseCommand
7
- from orionis.console.base.contracts.command import IBaseCommand
7
+ from orionis.console.contracts.command import IBaseCommand
8
8
  from orionis.console.contracts.reactor import IReactor
9
9
  from orionis.console.enums.command import Command
10
10
  from orionis.console.exceptions import CLIOrionisValueError
@@ -0,0 +1,23 @@
1
+ from dataclasses import dataclass
2
+ from orionis.console.entities.scheduler_event_data import SchedulerEventData
3
+
4
+ @dataclass(kw_only=True)
5
+ class AllJobsRemoved(SchedulerEventData):
6
+ """
7
+ Represents an event triggered when all jobs are removed from a specific job store.
8
+
9
+ This event is typically used to notify that a job store has been cleared of all its jobs.
10
+
11
+ Attributes
12
+ ----------
13
+ jobstore : str
14
+ The alias or identifier of the job store from which all jobs were removed.
15
+
16
+ Returns
17
+ -------
18
+ None
19
+ This class does not return a value; it is used to encapsulate event data.
20
+ """
21
+
22
+ # The alias of the job store from which jobs were removed
23
+ jobstore: str
@@ -0,0 +1,23 @@
1
+ from dataclasses import dataclass
2
+ from orionis.console.entities.scheduler_event_data import SchedulerEventData
3
+
4
+ @dataclass(kw_only=True)
5
+ class ExecutorAdded(SchedulerEventData):
6
+ """
7
+ Represents an event triggered when an executor is added to the system.
8
+
9
+ This event is used to notify that a new executor has been successfully added.
10
+
11
+ Attributes
12
+ ----------
13
+ alias : str
14
+ The unique alias or identifier of the added executor.
15
+
16
+ Returns
17
+ -------
18
+ ExecutorAdded
19
+ An instance of the ExecutorAdded event containing the alias of the added executor.
20
+ """
21
+
22
+ # The alias of the added executor, used to uniquely identify it
23
+ alias: str
@@ -0,0 +1,25 @@
1
+ from dataclasses import dataclass
2
+ from orionis.console.entities.scheduler_event_data import SchedulerEventData
3
+
4
+ @dataclass(kw_only=True)
5
+ class ExecutorRemoved(SchedulerEventData):
6
+ """
7
+ Represents an event triggered when an executor is removed.
8
+
9
+ This event is used to notify the system that a specific executor, identified
10
+ by its alias, has been removed from the scheduler.
11
+
12
+ Attributes
13
+ ----------
14
+ alias : str
15
+ The alias (unique identifier) of the removed executor.
16
+
17
+ Returns
18
+ -------
19
+ None
20
+ This class does not return a value; it is used as a data structure
21
+ to encapsulate event information.
22
+ """
23
+
24
+ # The alias of the removed executor
25
+ alias: str
@@ -0,0 +1,24 @@
1
+ from dataclasses import dataclass
2
+ from orionis.console.entities.job_event_data import JobEventData
3
+
4
+ @dataclass(kw_only=True)
5
+ class JobAdded(JobEventData):
6
+ """
7
+ Represents an event triggered when a job is added to a job store.
8
+
9
+ This class extends the `JobEventData` base class, inheriting its attributes
10
+ and functionality. It is used to encapsulate data related to the addition
11
+ of a job in the system.
12
+
13
+ Attributes
14
+ ----------
15
+ Inherits all attributes from the `JobEventData` base class.
16
+
17
+ Returns
18
+ -------
19
+ JobAdded
20
+ An instance of the `JobAdded` class containing data about the added job.
21
+ """
22
+
23
+ # This class currently does not define additional attributes or methods.
24
+ # It serves as a specialized event type for job addition events.
@@ -0,0 +1,35 @@
1
+ from dataclasses import dataclass
2
+ from datetime import datetime
3
+ from orionis.console.entities.job_event_data import JobEventData
4
+
5
+ @dataclass(kw_only=True)
6
+ class JobError(JobEventData):
7
+ """
8
+ Represents an event triggered when a job raises an exception during execution.
9
+
10
+ This class is used to encapsulate information about an error that occurred
11
+ during the execution of a scheduled job, including the time the job was
12
+ scheduled to run, the exception raised, and the traceback details.
13
+
14
+ Attributes
15
+ ----------
16
+ scheduled_run_time : datetime
17
+ The datetime when the job was scheduled to run.
18
+ exception : Exception
19
+ The exception instance raised by the job during execution.
20
+ traceback : str
21
+ The traceback string providing details about where the exception occurred.
22
+
23
+ Returns
24
+ -------
25
+ JobError
26
+ An instance of the `JobError` class containing details about the job error event.
27
+ """
28
+ # The time the job was scheduled to run
29
+ scheduled_run_time: datetime
30
+
31
+ # The exception raised during the job's execution
32
+ exception: Exception
33
+
34
+ # The traceback string providing details about the exception
35
+ traceback: str
@@ -0,0 +1,40 @@
1
+ from dataclasses import dataclass
2
+ from typing import Optional
3
+ from orionis.console.entities.scheduler_event_data import SchedulerEventData
4
+
5
+ @dataclass(kw_only=True)
6
+ class JobEventData(SchedulerEventData):
7
+ """
8
+ Represents the base class for events related to jobs in the scheduler system.
9
+
10
+ This class extends `SchedulerEventData` and provides additional attributes
11
+ specific to job-related events, such as the job's identifier and the job store
12
+ where it resides.
13
+
14
+ Attributes
15
+ ----------
16
+ code : int
17
+ A numeric code that uniquely identifies the type of event within the
18
+ scheduler system. (Inherited from `SchedulerEventData`)
19
+ alias : str, optional
20
+ An optional string providing additional context or identifying specific
21
+ components (e.g., executors or job stores) related to the event.
22
+ (Inherited from `SchedulerEventData`)
23
+ job_id : str
24
+ The unique identifier of the job associated with the event.
25
+ jobstore : str, optional
26
+ The name of the job store where the job is located. If not specified,
27
+ it defaults to `None`.
28
+
29
+ Returns
30
+ -------
31
+ JobEventData
32
+ An instance of the `JobEventData` class containing information about
33
+ the job-related event.
34
+ """
35
+
36
+ # The unique identifier of the job
37
+ job_id: str
38
+
39
+ # The name of the job store where the job resides (optional)
40
+ jobstore: Optional[str] = None