Skip to content

Commit

Permalink
Merge branch 'main' into task/landing-pages
Browse files Browse the repository at this point in the history
  • Loading branch information
djfarrelly committed Jun 12, 2024
2 parents 987f003 + 65ebde0 commit 4c7aa5b
Show file tree
Hide file tree
Showing 6 changed files with 127 additions and 26 deletions.
2 changes: 1 addition & 1 deletion pages/blog/_posts/lifecycle-emails-with-resend.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ Inngest greatly simplifies implementing an asynchronous, durable, event-driven w

```ts
export const userCreated = inngest.createFunction(
{ name: "A User Was Created" },
{ id: "user-created" },
{ event: "user/created" },
async ({ event, step }) => {
const { email } = event.user;
Expand Down
24 changes: 12 additions & 12 deletions pages/docs/guides/error-handling.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -280,19 +280,19 @@ inngest.createFunction(
async ({ event, step }) => {
// ignore the error - this step is fine if it fails
await step
.run("Non-critical step", () => {
.run("non-critical-step", () => {
return updateMetric();
})
.catch();

// Add a rollback to a step
await step
.run("Create row", async () => {
.run("create-row", async () => {
const row = await createRow(event.data.rowId);
await addDetail(event.data.entry);
})
.catch((err) =>
step.run("Rollback row creation", async () => {
step.run("rollback-row-creation", async () => {
await removeRow(event.data.rowId);
}),
);
Expand All @@ -304,19 +304,19 @@ inngestgo.CreateFunction(
inngestgo.FunctionOpts{ID: "add-data"},
inngestgo.EventTrigger("app/row.data.added", nil),
func(ctx context.Context, input inngestgo.Input[RowDataAddedEvent]) (any, error) {
_, _ = step.Run(ctx, "Non-critical step", func(ctx context.Context) (any, error) {
_, _ = step.Run(ctx, "non-critical-step", func(ctx context.Context) (any, error) {
return updateMetric()
})

_, err := step.Run(ctx, "Create row", func(ctx context.Context) (any, error) {
_, err := step.Run(ctx, "create-row", func(ctx context.Context) (any, error) {
_, err := createRow(input.Event.Data.RowID)
if err != nil {
return nil, err
}
return addDetail(input.Event.Data.Entry)
})
if err != nil {
_, err = step.Run(ctx, "Rollback row creation", func(ctx context.Context) (any, error) {
_, err = step.Run(ctx, "rollback-row-creation", func(ctx context.Context) (any, error) {
return removeRow(input.Event.Data.RowID)
})
if err != nil {
Expand Down Expand Up @@ -402,7 +402,7 @@ inngest.createFunction(
{ event: "user/weekly.digest.requested" },
async ({ event, step }) => {
const user = await step
.run("Get user email", () => {
.run("get-user-email", () => {
return db.users.findOne(event.data.userId);
})
.catch((err) => {
Expand All @@ -413,7 +413,7 @@ inngest.createFunction(
throw err;
});

await step.run("Send digest", () => {
await step.run("send-digest", () => {
return sendDigest(user.email);
});
},
Expand All @@ -424,7 +424,7 @@ inngestgo.CreateFunction(
inngestgo.FunctionOpts{ID: "user-weekly-digest"},
inngestgo.EventTrigger("user/weekly.digest.requested", nil),
func(ctx context.Context, input inngestgo.Input[WeeklyDigestRequestedEvent]) (any, error) {
user, err := step.Run(ctx, "Get user email", func(ctx context.Context) (any, error) {
user, err := step.Run(ctx, "get-user-email", func(ctx context.Context) (any, error) {
return db.Users.FindOne(input.Event.Data.UserID)
})
if err != nil {
Expand All @@ -434,7 +434,7 @@ inngestgo.CreateFunction(
return nil, err
}

_, err = step.Run(ctx, "Send digest", func(ctx context.Context) (any, error) {
_, err = step.Run(ctx, "send-digest", func(ctx context.Context) (any, error) {
return sendDigest(user.(UserType).Email)
})
if err != nil {
Expand All @@ -454,13 +454,13 @@ from inngest.errors import NonRetriableError
)
def user_weekly_digest(ctx: inngest.Context, step: inngest.StepSync) -> None:
try:
user = step.run("Get user email", db.users.find_one, ctx.event.data["userId"])
user = step.run("get-user-email", db.users.find_one, ctx.event.data["userId"])
except Exception as err:
if err.name == "UserNotFoundError":
raise NonRetriableError("User no longer exists; stopping")
raise

step.run("Send digest", send_digest, user["email"])
step.run("send-digest", send_digest, user["email"])
```
</CodeGroup>

Expand Down
106 changes: 106 additions & 0 deletions pages/docs/learn/glossary.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,106 @@
export const description = `Key terms for Inngest's documentation explained.`

# Glossary

This glossary serves as a quick reference for key terminology used in Inngest's documentation. The terms are organized alphabetically.

## Batching

Batching is one of the methods offered by Inngest's [Flow Control](#flow-control). It allows you to process multiple events in a single batch function to improve efficiency and reduce system load. By handling high volumes of data in batches, you can optimize performance, minimize processing time, and reduce costs associated with handling individual events separately. Read more about [Batching](https://www.inngest.com/docs/guides/batching).


## Concurrency Management

Concurrency management is one of the methods offered by Inngest's [Flow Control](#flow-control). It involves controlling the number of [steps](#inngest-step) executing simultaneously within a [function](#inngest-function). It prevents system overload by limiting how many processes run at once, which can be set at various levels such as globally, per-function, or per-user. This ensures efficient resource use and system stability, especially under high load conditions. Read more about [Concurrency Management](/docs/guides/concurrency).

## Debouncing

Debouncing is one of the methods offered by Inngest's [Flow Control](#flow-control). It prevents a [function](#inngest-function) from being executed multiple times in rapid succession by ensuring it is only triggered after a specified period of inactivity. This technique helps to eliminate redundant function executions caused by quick, repeated events, thereby optimizing performance and reducing unnecessary load on the system. It is particularly useful for managing user input events and other high-frequency triggers. Read more about [Debouncing](/docs/guides/debounce).

## Durable Execution

Durable Execution ensures that functions are fault-tolerant and resilient by handling failures and interruptions gracefully. It uses automatic retries and state persistence to allow [functions](#inngest-function) to continue running from the point of failure, even if issues like network failures or timeouts occur. This approach enhances the reliability and robustness of applications, making them capable of managing even complex and long-running workflows. Read more about [Durable Execution](/docs/learn/how-functions-are-executed).

## Fan-out Function

A fan-out function (also known as "fan-out job") in Inngest is designed to trigger multiple [functions](#inngest-function) simultaneously from a single [event](#inngest-event). This is particularly useful when an event needs to cause several different processes to run in parallel, such as sending notifications, updating databases, or performing various checks. Fan-out functions enhance the efficiency and responsiveness of your application by allowing concurrent execution of tasks, thereby reducing overall processing time and enabling complex workflows. Read more about [Fan-out Functions](/docs/guides/fan-out-jobs).

## Flow Control

Flow control in Inngest encompasses rate, throughput, priority, timing, and conditions of how functions are executed in regard to events. It helps optimize the performance and reliability of workflows by preventing bottlenecks and managing the execution order of tasks with tools like [steps](#inngest-step). Read more about [Flow Control](/docs/guides/flow-control).

## Function Replay

Function replay allows developers to rerun failed functions from any point in their execution history. This is useful for debugging and correcting errors without needing to manually re-trigger events, thus maintaining workflow integrity and minimizing downtime. Read more about [Function Replay](/docs/platform/replay).

## Idempotency

Idempotency is one of the methods offered by Inngest's [Flow Control](#flow-control). It guarantees that multiple identical requests have the same effect as a single request, preventing unintended side effects from repeated executions. By handling idempotency, you can avoid issues such as duplicate transactions or repeated actions, ensuring that your workflows remain accurate and dependable. Read more about [Handling idempotency](/docs/guides/handling-idempotency).


## Inngest App

Inngest apps are higher-level constructs that group multiple [functions](#inngest-function) and configurations under a single entity. An Inngest app can consist of various functions that work together to handle complex workflows and business logic. This abstraction helps in organizing and managing related functions and their configurations efficiently within the Inngest platform. Read more about [Inngest Apps](/docs/apps/cloud).

## Inngest Client

The Inngest client is a component that interacts with the Inngest platform. It is used to define and manage [functions](#inngest-function), send [events](#inngest-event), and configure various aspects of the Inngest environment. The client serves as the main interface for developers to integrate Inngest's capabilities into their applications, providing methods to create functions, handle events, and more. Read more about [Inngest Client](/docs/reference/client/create).

## Inngest Cloud

Inngest Cloud (also referred to as "Inngest UI" or inngest.com) is the managed service for running and managing your [Inngest functions](#inngest-function). It comes with multiple environments for developing, testing, and production. Inngest Cloud handles tasks like state management, retries, and scalability, allowing you to focus on building your application logic. Read more about [Inngest Cloud](/docs/platform/environments).

## Inngest Dev Server

The Inngest Dev Server provides a local development environment that mirrors the production setup. It allows developers to test and debug their [functions](#inngest-function) locally, ensuring that code behaves as expected before deployment. This tool significantly enhances the development experience by offering real-time feedback and simplifying local testing. Read more about [Inngest Dev Server](/docs/local-development).

## Inngest Event

An event is a trigger that initiates the execution of a [function](#inngest-function). Events can be generated from various sources, such as user actions or external services (third party webhooks or API requests). Each event carries data that functions use to perform their tasks. Inngest supports handling these events seamlessly. Read more about [Events](/docs/events).

## Inngest Function

Inngest functions are the fundamental building blocks of the Inngest platform,
which enable developers to run reliable background logic, from background jobs to complex workflows. They provide robust tools for retrying, scheduling, and coordinating complex sequences of operations. They are composed of [steps](#inngest-step) that can run independently and be retried in case of failure. Inngest functions are powered by [Durable Execution](#durable-execution), ensuring reliability and fault tolerance, and can be deployed on any platform, including serverless environments. Read more about [Inngest Functions](/docs/learn/inngest-functions).

## Inngest Step

In Inngest, a "step" represents a discrete, independently retriable unit of work within a [function](#inngest-function). Steps enable complex workflows by breaking down a function into smaller, manageable blocks, allowing for automatic retries and state persistence. This approach ensures that even if a step fails, only that task is retried, not the entire function. Read more about [Inngest Steps](/docs/learn/inngest-steps).

## Priority

Priority is one of the methods offered by Inngest's [Flow Control](#flow-control). It allows you to assign different priority levels to [functions](#inngest-function), ensuring that critical tasks are executed before less important ones. By setting priorities, you can manage the order of execution, improving the responsiveness and efficiency of your workflows. This feature is essential for optimizing resource allocation and ensuring that high-priority operations are handled promptly. Read more about [Priority](/docs/guides/priority).

{/* Once we add the new o11y
## Observability
Observability in Inngest refers to the ability to monitor and analyze the execution of functions. It includes features like real-time metrics, full logs, and historical data of function runs. This visibility helps in diagnosing issues, optimizing performance, and ensuring the reliability of applications. Read more about [Observability](). */}

## Rate Limiting

Rate limiting is one of the methods offered by Inngest's [Flow Control](#flow-control). It controls the frequency of [function](#inngest-function) executions over a specified period to prevent overloading the system. It helps manage API calls and other resources by setting limits on how many requests or processes can occur within a given timeframe, ensuring system stability and fair usage. Read more about [Rate Limiting](/docs/guides/rate-limiting).

## SDK

The Software Development Kit (SDK) is a collection of tools, libraries, and documentation that allows developers to easily integrate and utilize Inngest's features within their applications. The SDK simplifies the process of creating, managing, and executing functions, handling events, and configuring workflows. It supports multiple programming languages and environments, ensuring broad compatibility and ease of use. Currently, Inngest offers SDKs for TypeScript, Python, and Go. Read more about [Inngest SDKs](/docs/reference).

## Step Memoization

Step memoization in Inngest refers to the technique of storing the results of steps so they do not need to be re-executed if already completed. This optimization enhances performance and reliability by preventing redundant computations and ensuring that each step's result is consistently available for subsequent operations. Read more about [Step Memoization](/docs/learn/how-functions-are-executed#secondary-executions-memoization-of-steps).

## Throttling

Throttling is one of the methods offered by Inngest's [Flow Control](#flow-control). It controls the rate at which [functions](#inngest-function) are executed to prevent system overload. By setting limits on the number of executions within a specific timeframe, throttling ensures that resources are used efficiently and helps maintain the stability and performance of your application. It can be configured on a per-user or per-function basis, allowing for flexible and precise control over execution rates. Read more about [Throttling](/docs/guides/throttling).

## Next Steps

- Explore Inngest through our [Quick Start](/docs/quick-start).
- Learn about [Inngest Functions](/docs/learn/inngest-functions).
- Learn about [Inngest Steps](/docs/learn/inngest-steps).
- Understand how [Inngest functions are executed](/docs/learn/how-functions-are-executed).





2 changes: 1 addition & 1 deletion pages/docs/typescript.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ export default inngest.createFunction(
import { inngest } from "./client";

export default inngest.createFunction(
{ name: "Onboarding drip campaign" },
{ id: "Onboarding drip campaign" },
{ event: "user/new.signup" },
async ({ event, step }) => {
await step.run("Send welcome email", async () => {
Expand Down
10 changes: 0 additions & 10 deletions pages/pricing.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -318,16 +318,6 @@ const FEATURES: Feature[] = [
),
},
},
{
name: "Max sleep duration",
plans: {
[PLAN_NAMES.free]: "7 days",
[PLAN_NAMES.team]: "60 days",
[PLAN_NAMES.startup]: "6 months",
[PLAN_NAMES.enterprise]: "1 year",
},
infoUrl: "/docs/guides/delayed-functions?ref=pricing",
},
{
name: "Features",
heading: true,
Expand Down
9 changes: 7 additions & 2 deletions shared/Docs/navigationStructure.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import {
LifebuoyIcon,
PlayIcon,
QuestionMarkCircleIcon,
LightBulbIcon,
} from "@heroicons/react/24/outline";
import GoIcon from "src/shared/Icons/Go";
import GuideIcon from "src/shared/Icons/Guide";
Expand Down Expand Up @@ -57,6 +58,10 @@ const sectionGettingStarted: NavGroup[] = [
title: "Inngest steps",
href: `/docs/learn/inngest-steps`,
},
{
title: "Glossary",
href: `/docs/learn/glossary`,
},
{ title: "Installing the SDK", href: `/docs/sdk/overview` },
{ title: "Serving the API & Frameworks", href: `/docs/sdk/serve` },
{ title: "Sending Events", href: `/docs/events` },
Expand Down Expand Up @@ -976,7 +981,7 @@ export const menuTabs = [
},
{
title: "Examples",
icon: CogIcon,
icon: LightBulbIcon,
href: "/docs/examples",
matcher: matchers.examples,
},
Expand Down Expand Up @@ -1010,7 +1015,7 @@ export const topLevelNav = [
},
{
title: "Examples",
icon: CogIcon,
icon: LightBulbIcon,
href: "/docs/examples",
matcher: matchers.examples,
sectionLinks: sectionExamples,
Expand Down

0 comments on commit 4c7aa5b

Please sign in to comment.