Ruby SDKFeature Clients
Rate Limits ClientRuby SDK
Rate Limits client for managing rate limits within Hatchet.
This class provides a high-level interface for creating and updating rate limits using the gRPC Admin client.
hatchet.rate_limits.put(key: "api-calls", limit: 100, duration: :SECOND)It is available on the main client as hatchet.rate_limits.
Methods:
| Name | Description |
|---|---|
put | Put a rate limit for a given key. |
pause | Pause a rate limit key. |
Functions
put
Put a rate limit for a given key.
hatchet.rate_limits.put(key: "api-calls", limit: 100, duration: :SECOND)Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
key | String | The key to set the rate limit for. | required |
limit | Integer | The rate limit to set. | required |
duration | Symbol | The duration of the rate limit (:SECOND, :MINUTE, :HOUR) | :SECOND |
Raises:
| Type | Description |
|---|---|
GRPC::BadStatus | If the gRPC request fails. |
pause
Pause a rate limit key. Queued runs that consume it stay queued until the given time.
hatchet.rate_limits.pause(key: "upstream-api:tenant-123", until_time: Time.now + 30)Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
key | String | The rendered rate limit key to pause. | required |
until_time | Time | The time to pause the key until. An earlier time never shortens an existing pause. | required |
Returns:
| Type | Description |
|---|---|
Time | The time the key is paused until. |
Raises:
| Type | Description |
|---|---|
GRPC::BadStatus | If the gRPC request fails. |
Last updated on October 23, 2026