Inngest.Client (Inngest v0.3.0)

Copy Markdown View Source

Module representing an Inngest client (subject to change).

Summary

Functions

Builds a runtime Inngest client from explicit client options and environment.

Send one or a batch of events to Inngest

Types

mode()

@type mode() :: :cloud | :dev

send_result()

@type send_result() :: {:ok, map()} | {:error, binary()}

t()

@type t() :: %Inngest.Client{
  api_url: binary(),
  env: binary() | nil,
  event_key: binary(),
  event_url: binary(),
  funcs: [module()],
  http_client: module(),
  http_client_opts: Keyword.t(),
  http_pool_timeout: timeout(),
  http_receive_timeout: timeout(),
  http_request_timeout: timeout(),
  id: binary(),
  inngest_url: binary(),
  middleware: [Inngest.Middleware.normalized_entry()],
  mode: mode(),
  register_url: binary(),
  req_version: binary(),
  sdk_version: binary(),
  serve_origin: binary(),
  serve_path: binary() | nil,
  signing_key: binary(),
  signing_key_fallback: binary()
}

Functions

get(type, path, opts \\ [])

@spec get(atom(), binary(), Keyword.t()) ::
  {:ok, Inngest.HTTPClient.Response.t()} | {:error, term()}

headers(type, opts \\ [])

@spec headers(atom(), Keyword.t()) :: [{binary(), binary()}]

new(opts)

@spec new(Keyword.t()) :: t()

Builds a runtime Inngest client from explicit client options and environment.

post(type, path, payload, opts \\ [])

@spec post(atom(), binary(), term(), Keyword.t()) ::
  {:ok, Inngest.HTTPClient.Response.t()} | {:error, term()}

send(payload, opts \\ [])

@spec send(t(), Inngest.Event.t() | [Inngest.Event.t()]) :: send_result()
@spec send(Inngest.Event.t() | [Inngest.Event.t()], Keyword.t()) :: send_result()

Send one or a batch of events to Inngest

send(client, payload, opts)

@spec send(t(), Inngest.Event.t() | [Inngest.Event.t()], Keyword.t()) :: send_result()