Pigeon v1.1.1 Pigeon.Configurable protocol View Source

Link to this section Summary

Link to this section Types

Link to this type sock() View Source
sock() :: {:sslsocket, any, pid | {any, any}}

Link to this section Functions

Link to this function connect(config) View Source
connect(any) :: {:ok, sock} | {:error, String.t}
Link to this function handle_end_stream(config, stream, notification, on_response) View Source
Link to this function push_headers(config, notification, opts) View Source
Link to this function push_payload(config, notification, opts) View Source
Link to this function reconnect?(config) View Source
reconnect?(any) :: boolean

Returns whether connection should reconnect if dropped.

Examples

iex> reconnect?(%Pigeon.APNS.Config{reconnect: true})
true

iex> reconnect?(%Pigeon.FCM.Config{}) # always false
false
Link to this function schedule_ping(config) View Source
schedule_ping(any) :: no_return

Schedules connection ping if necessary.

Examples

iex> schedule_ping(%Pigeon.APNS.Config{ping_period: 2})
iex> receive do
...>   :ping -> "Got ping!"
...> after
...>   5000 -> "No ping received."
...> end
"Got ping!"

iex> schedule_ping(%Pigeon.FCM.Config{})
iex> receive do
...>   :ping -> "Got ping!"
...> after
...>   5000 -> "No ping received."
...> end
"No ping received."
Link to this function worker_name(config) View Source
worker_name(any) :: atom | nil

Returns worker name for config.

Examples

iex> worker_name(%Pigeon.APNS.Config{name: :test})
:test

iex> worker_name(%Pigeon.FCM.Config{name: :another})
:another