pub struct EventProcessor { /* private fields */ }Expand description
Processes and generates history events for execution tracking.
Implementations§
Source§impl EventProcessor
impl EventProcessor
Sourcepub fn format_timestamp(timestamp: DateTime<Utc>) -> String
pub fn format_timestamp(timestamp: DateTime<Utc>) -> String
Sourcepub fn current_timestamp() -> String
pub fn current_timestamp() -> String
Get the current timestamp formatted as ISO 8601 string.
Sourcepub fn create_nodejs_event(
&mut self,
event_type: NodeJsEventType,
operation: Option<&Operation>,
details: NodeJsEventDetails,
) -> NodeJsHistoryEvent
pub fn create_nodejs_event( &mut self, event_type: NodeJsEventType, operation: Option<&Operation>, details: NodeJsEventDetails, ) -> NodeJsHistoryEvent
Create a Node.js-compatible history event.
This method generates events with sequential EventId starting from 1, matching the Node.js SDK’s event format.
§Arguments
event_type- The type of event (e.g., ExecutionStarted, StepSucceeded)operation- Optional operation this event relates todetails- Event-specific details
§Returns
The created Node.js-compatible history event.
Sourcepub fn process_operation_update(
&mut self,
update: &OperationUpdate,
operation: &Operation,
) -> Vec<NodeJsHistoryEvent>
pub fn process_operation_update( &mut self, update: &OperationUpdate, operation: &Operation, ) -> Vec<NodeJsHistoryEvent>
Process an operation update and generate appropriate Node.js-compatible events.
This method maps (OperationAction, OperationType) combinations to the appropriate NodeJsEventType according to the design specification:
| Action | Type | EventType |
|---|---|---|
| Start | Execution | ExecutionStarted |
| Succeed | Execution | ExecutionSucceeded |
| Fail | Execution | ExecutionFailed |
| Start | Step | StepStarted |
| Succeed | Step | StepSucceeded |
| Fail | Step | StepFailed |
| Start | Wait | WaitStarted |
| Succeed | Wait | WaitSucceeded |
| Start | Callback | CallbackStarted |
| Start | Context | ContextStarted |
| Succeed | Context | ContextSucceeded |
| Fail | Context | ContextFailed |
§Arguments
update- The operation update containing action and typeoperation- The operation being updated
§Returns
A vector of generated Node.js-compatible history events.
Sourcepub fn get_nodejs_events(&self) -> &[NodeJsHistoryEvent]
pub fn get_nodejs_events(&self) -> &[NodeJsHistoryEvent]
Get all Node.js-compatible events.
Sourcepub fn into_nodejs_events(self) -> Vec<NodeJsHistoryEvent>
pub fn into_nodejs_events(self) -> Vec<NodeJsHistoryEvent>
Get Node.js-compatible events as owned vector.
Sourcepub fn nodejs_event_count(&self) -> u64
pub fn nodejs_event_count(&self) -> u64
Get the current Node.js event count.
Sourcepub fn clear_nodejs_events(&mut self)
pub fn clear_nodejs_events(&mut self)
Clear all Node.js-compatible events.
Sourcepub fn create_history_event<T: Serialize>(
&mut self,
event_type: EventType,
operation_id: Option<&str>,
details_type: &str,
details: T,
) -> HistoryEvent
pub fn create_history_event<T: Serialize>( &mut self, event_type: EventType, operation_id: Option<&str>, details_type: &str, details: T, ) -> HistoryEvent
Sourcepub fn get_events(&self) -> &[HistoryEvent]
pub fn get_events(&self) -> &[HistoryEvent]
Get all events.
Sourcepub fn into_events(self) -> Vec<HistoryEvent>
pub fn into_events(self) -> Vec<HistoryEvent>
Get events as owned vector.
Sourcepub fn event_count(&self) -> u64
pub fn event_count(&self) -> u64
Get the current event count.
Trait Implementations§
Source§impl Debug for EventProcessor
impl Debug for EventProcessor
Source§impl Default for EventProcessor
impl Default for EventProcessor
Source§fn default() -> EventProcessor
fn default() -> EventProcessor
Auto Trait Implementations§
impl Freeze for EventProcessor
impl RefUnwindSafe for EventProcessor
impl Send for EventProcessor
impl Sync for EventProcessor
impl Unpin for EventProcessor
impl UnsafeUnpin for EventProcessor
impl UnwindSafe for EventProcessor
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more