qsm v0.1.0 Qsm View Source

This module provides functionality for state machine interaction such as entry points and transitions

Link to this section Summary

Functions

Enqueue a work state on an SQS queue. This function should typically be used to create an entry point into your state machine

Asynchronously polls and handles state tranistions using the number of pollers when initializing the process

Initializes the qsm process that will eventually handle state polling and transitions

Link to this section Types

Link to this type queue_name() View Source
queue_name() :: String.t()
Link to this type state_data() View Source
state_data() :: any()

Link to this section Functions

Link to this function enqueue_work(queue_name, entry_state, entry_data \\ nil) View Source
enqueue_work(queue_name(), Qsm.State, state_data()) :: :ok

Enqueue a work state on an SQS queue. This function should typically be used to create an entry point into your state machine.

Examples

iex> Qsm.enqueue_work("my_worker_queue", Qsm.MockEntryState, "test_data")
:ok
Link to this function run_async(pid) View Source
run_async(PID) :: :ok

Asynchronously polls and handles state tranistions using the number of pollers when initializing the process.

Examples

iex> {:ok, pid} = Qsm.start_link("test_queue", 1)
iex> Qsm.run_async(pid)
:ok
Link to this function start_link(queue_name, num_pollers \\ 1) View Source
start_link(queue_name(), integer()) :: {:ok, PID}

Initializes the qsm process that will eventually handle state polling and transitions.

Examples

iex> {:ok, pid} = Qsm.start_link("test_queue", 1)
iex> is_pid(pid)
true