GSS.Client.Request (elixir_google_spreadsheets v0.3.2)

Worker of Request subscribed to Limiter, call request to API and send an answer to Client.

Link to this section Summary

Functions

Set the subscription to manual to control when to ask for events

Callback implementation for GenStage.init/1.

Starts an request worker linked to the current process. Takes events from Limiter and send requests through HTTPoison

Link to this section Types

Specs

options() :: [name: atom() | nil, limiters: [{atom(), keyword()} | atom()]]

Specs

state() :: :ok

Link to this section Functions

Link to this function

handle_events(list, from, state)

Specs

handle_events([GSS.Client.event()], GenStage.from(), state()) ::
  {:noreply, [], state()}

Callback implementation for GenStage.handle_events/3.

Link to this function

handle_subscribe(atom, options, from, state)

Set the subscription to manual to control when to ask for events

Callback implementation for GenStage.init/1.

Link to this function

start_link(args)

Specs

start_link(options()) :: GenServer.on_start()

Starts an request worker linked to the current process. Takes events from Limiter and send requests through HTTPoison

Options

  • :name - used for name registration as described in the "Name registration" section of the module documentation. Default is Elixir.GSS.Client.Request
  • :limiters - list of limiters with max_demand options. For example [{Elixir.GSS.Client.Limiter, max_demand: 1}].