View Source BtrzWebhooksEmitter.SQS (BtrzWebhooksEmitter v1.1.4)

Genserver for emitting events to the configured AWS SQS

If there is no SQS_QUEUE_NAME, the GenServer will be started with :ignore and the process will exit normally.

Link to this section Summary

Types

Response for every function

Functions

Returns a specification to start this module under a supervisor.

Emits messages asynchrounously Returns always :ok

Emits messages asynchrounously to a specific queue URL. The opts keyword list supports :queue_url to override the default queue. Returns always :ok

Emits messages synchrounously For particular use, try always to use emit/2 if possible. Returns emit_sync_response :: {:ok, term} | {:error, term}

Emits messages synchrounously to a specific queue URL. The opts keyword list supports :queue_url to override the default queue. Returns emit_sync_response :: {:ok, term} | {:error, term}

Sends sync the message to AWS SQS and returns {:ok, result}. If something fails, it will log the error and returns {:error, reason}

Sends async the message to AWS SQS. If something fails, it will just log the error.

Callback implementation for GenServer.init/1.

Starts a new BtrzWebhooksEmitter process.

Link to this section Types

@type emit_sync_response() :: {:ok, term()} | {:error, term()}

Response for every function

Link to this section Functions

Returns a specification to start this module under a supervisor.

See Supervisor.

@spec emit(GenServer.server(), map()) :: :ok

Emits messages asynchrounously Returns always :ok

Link to this function

emit(server, message, opts)

View Source
@spec emit(GenServer.server(), map(), keyword()) :: :ok

Emits messages asynchrounously to a specific queue URL. The opts keyword list supports :queue_url to override the default queue. Returns always :ok

Link to this function

emit_sync(server, message)

View Source
@spec emit_sync(GenServer.server(), map()) :: emit_sync_response()

Emits messages synchrounously For particular use, try always to use emit/2 if possible. Returns emit_sync_response :: {:ok, term} | {:error, term}

Link to this function

emit_sync(server, message, opts)

View Source
@spec emit_sync(GenServer.server(), map(), keyword()) :: emit_sync_response()

Emits messages synchrounously to a specific queue URL. The opts keyword list supports :queue_url to override the default queue. Returns emit_sync_response :: {:ok, term} | {:error, term}

Link to this function

handle_call(msg, from, state)

View Source

Sends sync the message to AWS SQS and returns {:ok, result}. If something fails, it will log the error and returns {:error, reason}

Sends async the message to AWS SQS. If something fails, it will just log the error.

Callback implementation for GenServer.init/1.

Link to this function

start_link(aws_config, opts \\ [])

View Source

Starts a new BtrzWebhooksEmitter process.