Skip to content

Commit

Permalink
Add typedoc for debounce
Browse files Browse the repository at this point in the history
  • Loading branch information
darwin67 committed Nov 27, 2023
1 parent ab2ab99 commit 48b4b03
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions lib/inngest/function/config.ex
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,22 @@ defmodule Inngest.FnOpts do
cancel_on: cancel_on() | nil
}

@typedoc """
Options to configure function debounce ([reference](https://www.inngest.com/docs/reference/functions/debounce)).
**period** - `string` required
The time period of which to set the limit. The period begins when the first matching event is received. How long to wait before invoking the function with the batch even if it's not full. Current permitted values are from `1s` to `7d (168h)`.
**key** - `string` optional
A unique key expression to apply the debounce to. The expression is evaluated for each triggering event.
Expressions are defined using the [Common Expression Language (CEL)](https://github.com/google/cel-go) with the original event accessible using dot-notation. Examples:
* Debounce per customer id: `event.data.customer_id`
* Debounce per account and email address: `event.data.account_id + "-" + event.user.email`
"""
@type debounce() :: %{
key: binary() | nil,
period: binary()
Expand Down

0 comments on commit 48b4b03

Please sign in to comment.