Fly (Fly RPC v0.1.6) View Source

Functions and features to help Elixir applications more easily take advantage of the features that Fly.io provides.

Link to this section Summary

Functions

Return if the app instance is running in the primary region or not. Boolean result.

Return the configured current region. Reads the FLY_REGION ENV setting that's available when deployed on the Fly.io platform. If not set, it returns "local".

Return the configured primary region. Reads and requires an ENV setting for PRIMARY_REGION. If not set, it returns "local".

Execute the MFA on a node in the primary region.

Link to this section Functions

Specs

is_primary?() :: no_return() | boolean()

Return if the app instance is running in the primary region or not. Boolean result.

Specs

my_region() :: String.t()

Return the configured current region. Reads the FLY_REGION ENV setting that's available when deployed on the Fly.io platform. If not set, it returns "local".

Specs

primary_region() :: String.t()

Return the configured primary region. Reads and requires an ENV setting for PRIMARY_REGION. If not set, it returns "local".

Link to this function

rpc_primary(module, func, args, opts \\ [])

View Source

Specs

rpc_primary(module(), atom(), [any()], keyword()) :: any()

Execute the MFA on a node in the primary region.