Skip to content

feat: Add flow control attributes for production payment processing (v1.4.0)#8

Merged
jmarbutt merged 1 commit intomainfrom
feature/flow-control-attributes
Jan 5, 2026
Merged

feat: Add flow control attributes for production payment processing (v1.4.0)#8
jmarbutt merged 1 commit intomainfrom
feature/flow-control-attributes

Conversation

@jmarbutt
Copy link
Owner

@jmarbutt jmarbutt commented Jan 5, 2026

Summary

  • Adds [Throttle] attribute: QUEUES events at a rate limit (unlike RateLimit which DROPS). Critical for payment processing where losing events is unacceptable.
  • Adds [Idempotency] attribute: Prevents duplicate processing using a CEL expression key. Ensures only one execution per unique key.
  • Adds [Timeout] attribute: Cancels hanging functions to prevent queue buildup. Supports both Start (queue timeout) and Finish (execution timeout).

These features enable safe migration of Node.js Inngest handlers to .NET for payment processing that cannot tolerate duplicate charges or lost events.

Example Usage

[InngestFunction("payment-processor")]
[EventTrigger("payment/received")]
[Throttle(20, "1m", Key = "event.data.customerId")]  // Queue, don't drop
[Concurrency(1, Key = "event.data.paymentId")]       // Serialize per payment
[Idempotency("event.data.paymentId")]                // One execution per payment
[Timeout(Finish = "30s")]                            // Cancel if hanging
public class PaymentProcessorFunction : IInngestFunction { }

Closes #7

Test plan

  • All 124 existing tests pass
  • Solution builds with no errors
  • Added example functions demonstrating the new attributes
  • Manual test with Inngest dev server to verify registration payload

🤖 Generated with Claude Code

…v1.4.0)

Adds three new attributes for production-grade function configuration:

- [Throttle]: QUEUES events at a rate limit (unlike RateLimit which DROPS)
  Critical for payment processing where losing events is unacceptable.
  Example: [Throttle(20, "1m", Key = "event.data.customerId")]

- [Idempotency]: Prevents duplicate processing using a CEL expression key.
  Ensures only one execution per unique key (e.g., contribution ID).
  Example: [Idempotency("event.data.contributionId")]

- [Timeout]: Cancels hanging functions to prevent queue buildup.
  Supports both Start (queue timeout) and Finish (execution timeout).
  Example: [Timeout(Finish = "30s")]

These features are required for migrating Node.js Inngest handlers to .NET,
particularly for payment processing that cannot tolerate duplicate charges
or lost events.

Closes #7

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@jmarbutt jmarbutt merged commit ac9998a into main Jan 5, 2026
2 checks passed
@jmarbutt jmarbutt deleted the feature/flow-control-attributes branch January 5, 2026 23:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Missing Flow Control Features Required for Production Payment Processing

1 participant