OpenAperture.Builder.BuildLogPublisher.ExchangePublisher

Summary↑

close_connection(connection_options \\ nil)

Method to completely close a connection (and all associated subscriptions, channels, connections, etc…)

publish(connection_options \\ nil, queue, payload)

Publishes a message/payload to a specific queue within the Messaging system

publish_build_logs(pid, workflow_id, logs)
publish_rpc(connection_options \\ nil, queue, api, request)

Publishes a an RPC request to a specific queue within the Messaging system

start_link(exchange_id)
subscribe(connection_options \\ nil, queue, callback_handler)

Subscribes to a specific queue within the Messaging system

unsubscribe(connection_options \\ nil, subscription_handler)

Unsubscribes to from a SubscriptionHandler in the Messaging system

Functions

close_connection(connection_options \\ nil)

Specs:

  • close_connection(OpenAperture.Messaging.ConnectionOptions.t) :: :ok | {:error, String.t}

Method to completely close a connection (and all associated subscriptions, channels, connections, etc…)

Options

The connection_options options value provides the ConnectionOptions; defaults to the @connection_options attribute

Returns

:ok | {:error, reason}

publish(connection_options \\ nil, queue, payload)

Specs:

  • publish(OpenAperture.Messaging.ConnectionOptions.t, OpenAperture.Messaging.Queue.t, term) :: :ok | {:error, String.t}

Publishes a message/payload to a specific queue within the Messaging system

Options

The connection_options options value provides the ConnectionOptions; defaults to the @connection_options attribute

The queue options value provides the Queue to which to subscribe

The payload option represents the message data

Returns

:ok | {:error, reason}

publish_build_logs(pid, workflow_id, logs)

Specs:

publish_rpc(connection_options \\ nil, queue, api, request)

Publishes a an RPC request to a specific queue within the Messaging system

Options

The connection_options options value provides the ConnectionOptions; defaults to the @connection_options attribute

The queue options value provides the Queue to which to subscribe

The request option represents the message data

Returns

{:ok, OpenAperture.Messaging.AMQP.RpcHandler} | {:error, reason}

start_link(exchange_id)

Specs:

subscribe(connection_options \\ nil, queue, callback_handler)

Specs:

  • subscribe(OpenAperture.Messaging.ConnectionOptions.t, OpenAperture.Messaging.Queue.t, term) :: {:ok, term} | {:error, String.t}

Subscribes to a specific queue within the Messaging system.

Options

The connection_options options value provides the ConnectionOptions; defaults to the @connection_options attribute

The queue options value provides the Queue to which to subscribe

The callback_handler option represents the method that should be called when a message is received. The handler should be a function with 2 arguments (sync), or 3 arguments (async).

Returns

for AMQP:

{:ok, subscription_handler} | {:error, reason}
unsubscribe(connection_options \\ nil, subscription_handler)

Specs:

  • unsubscribe(OpenAperture.Messaging.ConnectionOptions.t, pid) :: :ok | {:error, String.t}

Unsubscribes to from a SubscriptionHandler in the Messaging system.

Options

The connection_options options value provides the ConnectionOptions; defaults to the @connection_options attribute

The subscription_handler option represents the PID of the SubscriptionHandler

Returns

for AMQP: :ok | {:error, reason}