• Что бы вступить в ряды "Принятый кодер" Вам нужно:
    Написать 10 полезных сообщений или тем и Получить 10 симпатий.
    Для того кто не хочет терять время,может пожертвовать средства для поддержки сервеса, и вступить в ряды VIP на месяц, дополнительная информация в лс.

  • Пользаватели которые будут спамить, уходят в бан без предупреждения. Спам сообщения определяется администрацией и модератором.

  • Гость, Что бы Вы хотели увидеть на нашем Форуме? Изложить свои идеи и пожелания по улучшению форума Вы можете поделиться с нами здесь. ----> Перейдите сюда
  • Все пользователи не прошедшие проверку электронной почты будут заблокированы. Все вопросы с разблокировкой обращайтесь по адресу электронной почте : info@guardianelinks.com . Не пришло сообщение о проверке или о сбросе также сообщите нам.

Inngest Overview & Development Guide

Lomanu4 Оффлайн

Lomanu4

Команда форума
Администратор
Регистрация
1 Мар 2015
Сообщения
1,481
Баллы
155
What is Inngest?


Inngest is an event-driven background job platform designed to work seamlessly with modern frameworks and serverless environments. It allows you to build durable, asynchronous workflows using events and functions, similar to AWS Step Functions, but with a more developer-friendly DX.

Key Features


Event-based: Trigger functions using custom events (user.signed_up, order.placed, etc.).


  • Durable workflows: Built-in retries, step execution, and time-based delays.


  • Local development: Use the Inngest Dev Server to test workflows without deploying.


  • Framework-agnostic: Works with Next.js, Express, and other frameworks.


  • Strong typing: Full TypeScript support for event payloads and responses.
Getting Started


Install Inngest


npm install inngest

Initialize Inngest Client


// inngest.ts
import { Inngest } from "inngest";

export const inngest = new Inngest({ name: "My App" });

Create an Event-Driven Function


// functions/userSignup.ts
import { inngest } from "../inngest";

export const sendWelcomeEmail = inngest.createFunction(
{ id: "send-welcome-email" },
{ event: "user.signed_up" },
async ({ event }) => {
// your logic here
console.log(`Welcome ${event.data.email}!`);
}
);

Serve Functions in Your App
For Next.js:


// pages/api/inngest.ts
import { serve } from "inngest/next";
import { sendWelcomeEmail } from "../../functions/userSignup";
import { inngest } from "../../inngest";

export default serve(inngest, [sendWelcomeEmail]);
Local Development


Install Inngest Dev CLI


npm install --global inngest-cli

Start Dev Server


inngest dev
This spins up a local dashboard and event relay server. It watches your local functions and simulates the production environment.
Send Test Events
Use the Dev UI or CLI to trigger events:


inngest send --name user.signed_up --data '{"email":"test@example.com"}'
? Tips for Development


Step Functions: You can add delays or conditional steps in workflows using the step.run API.

Debugging: Use the Inngest Dev dashboard to view function execution, logs, and step state.

Retries: Automatic retrying is handled for failed steps unless configured otherwise.

Environment separation: Use different Inngest apps for development, staging, and production.


Пожалуйста Авторизируйтесь или Зарегистрируйтесь для просмотра скрытого текста.

 
Вверх Снизу