View Source Pigeon.Configurable protocol (Pigeon v1.6.3)

Summary

Types

t()

All the types that implement this protocol.

Types

@type sock() :: {:sslsocket, any(), pid() | {any(), any()}}
@type t() :: term()

All the types that implement this protocol.

Functions

@spec connect(any()) :: {:ok, sock()} | {:error, String.t()}
Link to this function

handle_end_stream(config, stream, notification, on_response)

View Source
@spec max_demand(any()) :: non_neg_integer()
Link to this function

push_headers(config, notification, opts)

View Source
Link to this function

push_payload(config, notification, opts)

View Source
@spec 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."
@spec validate!(any()) :: :ok | no_return()
@spec 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