Plexus.Contract (Plexus v0.1.0)

Copy Markdown View Source

Shared prepared TypeSafe contracts.

This module centralizes the parts of TypeSafeSDK we want to reuse across many actors:

  • prepare!/1
  • stable prepared fingerprints
  • evaluate/4
  • evaluate_stream/4
  • evaluate_many/4

Summary

Functions

batch_many(client, states, prepared_or_questions, opts \\ [])

batch_stream(client, states, prepared_or_questions, opts \\ [])

evaluate(client, state, prepared_or_questions, opts \\ [])

@spec evaluate(
  TypeSafeSDK.Client.t(),
  term(),
  TypeSafeSDK.Prepared.t() | keyword(),
  keyword()
) ::
  {:ok, term()} | {:error, term()}

fingerprint(prepared)

@spec fingerprint(TypeSafeSDK.Prepared.t()) :: String.t()

memo_key(state, prepared)

@spec memo_key(term(), TypeSafeSDK.Prepared.t()) :: String.t()

memo_key(state, prepared, opts)

@spec memo_key(term(), TypeSafeSDK.Prepared.t(), keyword()) :: String.t()

Memo identity including effective evaluation options; operational batching controls are excluded.

new!(questions)

@spec new!(keyword()) :: TypeSafeSDK.Prepared.t()