process_store v0.1.0 ProcessStore View Source

A Facility to store and retrieve a data from the process dictionary.

Link to this section Summary

Functions

Retrieve the value of key from the Process or from the $callers dictionaries.

Store the passed value in the dictionary of the current Process using the passed key.

Link to this section Types

Link to this section Functions

Retrieve the value of key from the Process or from the $callers dictionaries.

Returns the first found occurrence.

Examples

iex> ProcessStore.fetch(:my_key)
"anything"

iex> ProcessStore.fetch(:non_existing_key)
nil
Link to this function

store(key, value)

View Source
store(key(), data()) :: data()

Store the passed value in the dictionary of the current Process using the passed key.

The return value of this function is the value that was previously stored under the same key, or nil in case no value was stored before.

Examples

iex> ProcessStore.store(:my_key, anything")
nil

iex> ProcessStore.store(:my_key, "somethingelse")
"anything"