Skip to content

Change FaultAction to support async logic #427

@jonnepmyra

Description

@jonnepmyra

Is your feature request related to a problem? Please describe.

I’d like to suggest a change to the FaultAction delegate. Right now, it returns a ChunkAction directly, which means I can't easily run asynchronous logic inside the handler (e.g., closing the consumer.).

The current delegate is defined as something like:
Func<IConsumer, ChunkAction> FailAction { get; init; }

This makes it impossible to await anything inside the function.

Describe the solution you'd like

Change the delegate to support async operations by returning a Task:

Func<IConsumer, Task<ChunkAction>> FailAction { get; init; }

This would allow users to await async code without workarounds like blocking on async calls.

Describe alternatives you've considered

No response

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions