Presto v0.1.2 Presto View Source

Presto pages!

Link to this section Summary

Functions

Creates a new page process based on the page_module, and page_key. Returns a tuple such as {:ok, page_key} if successful. If there is an issue, an {:error, reason} tuple is returned

Finds an existing page process based on the page_module, and page_key. If the page is not found, it is created and returned instead. Returns a tuple such as {:ok, page_key} if successful. If there is an issue, an {:error, reason} tuple is returned

Finds an existing page process based on the page_module, and page_key. Returns a tuple such as {:ok, page_key} if successful. If there is an issue, an {:error, reason} tuple is returned

Determines if a Presto.Page process exists, based on the page_key provided. Returns a boolean

Link to this section Types

Link to this type page_create() View Source
page_create() :: {:ok, Presto.page_key} | {:error, term}
Link to this type page_event() View Source
page_event() :: term
Link to this type page_module() View Source
page_module() :: atom

Link to this section Functions

Link to this function component(page_module, page_key) View Source
component(page_module, page_key) :: any

Embed a component.

Link to this function create_page(page_module, page_key) View Source
create_page(page_module, page_key) :: page_create

Creates a new page process based on the page_module, and page_key. Returns a tuple such as {:ok, page_key} if successful. If there is an issue, an {:error, reason} tuple is returned.

Link to this function dispatch(page_module, page_key, message) View Source
dispatch(page_module, page_key, page_event) :: any

Send an event to a page.

Link to this function find_or_create_page(page_module, page_key) View Source
find_or_create_page(page_module, page_key) :: page_create

Finds an existing page process based on the page_module, and page_key. If the page is not found, it is created and returned instead. Returns a tuple such as {:ok, page_key} if successful. If there is an issue, an {:error, reason} tuple is returned.

Link to this function find_page(page_module, page_key) View Source

Finds an existing page process based on the page_module, and page_key. Returns a tuple such as {:ok, page_key} if successful. If there is an issue, an {:error, reason} tuple is returned.

Link to this function page_exists?(page_module, page_key) View Source
page_exists?(page_module, page_key) :: boolean

Determines if a Presto.Page process exists, based on the page_key provided. Returns a boolean.

Example

iex> Presto.page_exists?(DemoPage, 6)
false