Giocci (giocci v0.3.1)

Copy Markdown

Client API for Giocci.

Summary

Functions

Execute a function on an engine via the relay.

Execute a function asynchronously and send the result to server.

Register this client to a relay.

Save a module to the relay.

Functions

exec_func(relay_name, mfargs, opts \\ [])

@spec exec_func(String.t(), tuple(), keyword()) :: result :: term()

Execute a function on an engine via the relay.

Options:

  • :timeout - Client call timeout in milliseconds.
  • :measure_to - When set to a pid, sends measurement timestamps as {:giocci_measurements, timestamps} to that process.

exec_func_async(relay_name, mfargs, server, opts \\ [])

@spec exec_func_async(String.t(), tuple(), GenServer.server(), keyword()) ::
  :ok | {:error, reason :: term()}

Execute a function asynchronously and send the result to server.

The result is delivered to server as {:giocci, result}.

Options:

  • :timeout - Client call timeout in milliseconds.
  • :measure_to - When set to a pid, sends measurement timestamps as {:giocci_measurements, timestamps} to that process.

register_client(relay_name, opts \\ [])

@spec register_client(
  String.t(),
  keyword()
) :: :ok | {:error, reason :: term()}

Register this client to a relay.

Options:

  • :timeout - Client call timeout in milliseconds.
  • :measure_to - When set to a pid, sends measurement timestamps as {:giocci_measurements, timestamps} to that process.

save_module(relay_name, module, opts \\ [])

@spec save_module(String.t(), module(), keyword()) :: :ok | {:error, reason :: term()}

Save a module to the relay.

Options:

  • :timeout - Client call timeout in milliseconds.
  • :measure_to - When set to a pid, sends measurement timestamps as {:giocci_measurements, timestamps} to that process.