PhoenixGenApi.ConfigPuller (PhoenixGenApi v1.1.2)

View Source

This module is responsible for periodically pulling function configurations (%FunConfig{}) from remote nodes and updating the ConfigDb.

The puller's behavior can be configured in your config.exs file:

config :phoenix_gen_api, :gen_api,
  pull_timeout: 5_000,
  pull_interval: 30_000
  • pull_timeout: The timeout for each RPC call in milliseconds (default: 5000).
  • pull_interval: The interval between each pull operation in milliseconds (default: 30000).

Summary

Functions

Adds a list of services to the puller. The services argument must be a list of %ServiceConfig{} structs.

Returns a specification to start this module under a supervisor.

Deletes a list of services from the puller. The services argument must be a list of %ServiceConfig{} structs.

Returns the list of APIs for a given service.

Returns the map of services currently being pulled from.

Forces an immediate pull of configurations from the registered services.

Starts the ConfigPuller GenServer.

Functions

add(services)

Adds a list of services to the puller. The services argument must be a list of %ServiceConfig{} structs.

child_spec(init_arg)

Returns a specification to start this module under a supervisor.

See Supervisor.

delete(services)

Deletes a list of services from the puller. The services argument must be a list of %ServiceConfig{} structs.

get_api_list(service)

Returns the list of APIs for a given service.

get_services()

Returns the map of services currently being pulled from.

pull()

Forces an immediate pull of configurations from the registered services.

start_link(opts \\ [])

Starts the ConfigPuller GenServer.