Skip to content

[Feature]: Emit events when a task retries #75

@thalesraymond

Description

@thalesraymond

Description

Currently, the RetryingExecutionStrategy handles retries silently. The main TaskRunner only emits taskStart and taskEnd. Users have no visibility into whether a task is succeeding on the first try or failing and retrying, which is crucial for debugging flaky services.

Proposed Solution

  1. Add a taskRetry event to RunnerEventPayloads in RunnerEvents.ts.
     taskRetry: {
       step: TaskStep<TContext>;
       attempt: number;
       error: any;
     };
  1. Update RetryingExecutionStrategy so it accepts the EventBus (or a callback) to emit this event when a retry is triggered.

Alternatives Considered

Passing a custom logger to the strategy, but an event-driven approach is more consistent with the rest of the library.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions