View Source Inngest.Event (Inngest v0.2.1)

Module representing an Inngest event.

As you might guess, Events are the fundamentals of an event driven system. Inngest starts and ends with events. An event is the trigger for functions to start, resume and can also hold the data for functions to operate on.

An Inngest.Event looks like this:

%{
  id: "",
  name: "event/awesome",
  data: { "hello": "world" },
  ts: 1690156151,
  v: "2023.04.14.1"
}

id - string optional

The id field in an event payload is used for deduplication. Setting this field will make sure that only one of the events (the first one) with a similar id is processed.

name - string required

The name of the event. We recommend using lowercase dot notation for names, prepending <prefixes>/ with a slash for organization.

data - map required

Any data to associate with the event. Will be serialized as JSON.

ts - integer optional

A timestamp integer representing the unix time (in milliseconds) at which the event occurred. Defaults to the time the Inngest receives the event if not provided.

v - string optional

A version identifier for a particular event payload. e.g. 2023-04-14.1

Summary

Functions

Construct an Event struct from a map.

Types

@type t() :: %Inngest.Event{
  data: map(),
  datetime: DateTime.t() | nil,
  id: binary() | nil,
  name: binary(),
  ts: number() | nil,
  v: binary() | nil
}

Functions

@spec from(map()) :: t()

Construct an Event struct from a map.