OpenAperture.Builder.Dispatcher
This module contains the logic to dispatch Builder messsages to the appropriate GenServer(s)
Summary↑
| acknowledge(delivery_tag) | Method to acknowledge a message has been processed |
| close_connection(connection_options \\ nil) | Method to completely close a connection (and all associated subscriptions, channels, connections, etc…) |
| execute_milestone(arg1, arg2) | Method to finish executing the Builder request flow (successfully) |
| process_request(builder_request) | Method to process an incoming Builder request |
| publish(connection_options \\ nil, queue, payload) | Publishes a message/payload to a specific queue within the Messaging system |
| publish_rpc(connection_options \\ nil, queue, api, request) | Publishes a an RPC request to a specific queue within the Messaging system |
| register_queues() | Method to register the Builder queues with the Messaging system |
| reject(delivery_tag, redeliver \\ false) | Method to reject a message has been processed |
| start_link() | Specific start_link implementation (required by the supervisor) |
| 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
Specs:
- acknowledge(String.t) :: term
Method to acknowledge a message has been processed
Options
The delivery_tag option is the unique identifier of the message
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}
Specs:
- execute_milestone(:completed, {:ok, OpenAperture.Builder.Request.t}) :: term
- execute_milestone(:verify_build_exists, {:ok, OpenAperture.Builder.Request.t}) :: {:ok, OpenAperture.Builder.Request.t} | {:error, String.t, OpenAperture.Builder.Request.t}
- execute_milestone(:build, {:ok, OpenAperture.Builder.Request.t}) :: {:ok, OpenAperture.Builder.Request.t} | {:error, String.t, OpenAperture.Builder.Request.t}
- execute_milestone(:config, {:ok, OpenAperture.Builder.Request.t}) :: {:ok, OpenAperture.Builder.Request.t} | {:error, String.t, OpenAperture.Builder.Request.t}
- execute_milestone(term, {:error, String.t, OpenAperture.Builder.Request.t}) :: term
Method to finish executing the Builder request flow (successfully)
Options
The request option defines the BuilderRequest
Specs:
- process_request(OpenAperture.Builder.Request.t) :: term
Method to process an incoming Builder request
Options
The request option defines the BuilderRequest
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}
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}
Specs:
- register_queues :: :ok | {:error, String.t}
Method to register the Builder queues with the Messaging system
Return Value
:ok | {:error, reason}
Specs:
- reject(String.t, term) :: term
Method to reject a message has been processed
Options
The delivery_tag option is the unique identifier of the message
The redeliver option can be used to requeue a message
Specs:
- start_link :: {:ok, pid} | {:error, String.t}
Specific start_link implementation (required by the supervisor)
Options
Return Values
{:ok, pid} | {:error, reason}
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}
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}