def _schedule_timers( context: ContextBuilder, id_counter: int) -> Tuple[ContextBuilder, int, List[datetime]]: """Add timer created events to the context. Parameters ---------- context: ContextBuilder Orchestration context mock, to which we'll add the event completion events id_counter: int The current event counter Returns ------- Tuple[ContextBuilder, int, List[datetime]]: The updated context, the updated counter, a list of timer deadlines """ deadlines: List[datetime] = [] for _ in range(num_activities): deadlines.append( (id_counter, context.add_timer_created_event(id_counter))) id_counter += 1 return context, id_counter, deadlines
def add_timer_fired_events(context_builder: ContextBuilder, id_: int, timestamp: str, is_played: bool = True): fire_at: str = context_builder.add_timer_created_event(id_, timestamp) context_builder.add_orchestrator_completed_event() context_builder.add_orchestrator_started_event() context_builder.add_timer_fired_event(id_=id_, fire_at=fire_at, is_played=is_played)
def add_retry_timer_events(context_builder: ContextBuilder, id_: int): fire_at = context_builder.add_timer_created_event(id_) context_builder.add_orchestrator_completed_event() context_builder.add_orchestrator_started_event() context_builder.add_timer_fired_event(id_=id_, fire_at=fire_at)