PolyPost.Depot (poly_post v0.2.0)

Copy Markdown View Source

A process to manage the content for a resource (articles, etc.).

Summary

Functions

Returns a specification to start this module under a supervisor.

Removes all the content related to the resouce.

Counts the units of content under a resource

Checks to see if a depot process for a resource exists.

Finds specific content by a key for the resource.

Gets all content for a resource.

Callback implementation for GenServer.init/1.

Inserts content for a resource via a key

Starts the Depot process with a given name to represent the resource.

Functions

child_spec(init_arg)

Returns a specification to start this module under a supervisor.

See Supervisor.

clear(name)

(since 0.1.0)
@spec clear(PolyPost.Resource.name()) :: :ok

Removes all the content related to the resouce.

count(name)

(since 0.2.0)

Counts the units of content under a resource

exists?(name)

(since 0.2.0)
@spec exists?(PolyPost.Resource.name()) :: boolean()

Checks to see if a depot process for a resource exists.

find(name, key)

(since 0.1.0)

Finds specific content by a key for the resource.

get_all(name)

(since 0.1.0)

Gets all content for a resource.

handle_continue(name, state)

Callback implementation for GenServer.handle_continue/2.

init(name)

Callback implementation for GenServer.init/1.

insert(name, key, content)

(since 0.1.0)

Inserts content for a resource via a key

start_link(name)

(since 0.1.0)
@spec start_link(PolyPost.Resource.name()) :: GenServer.on_start()

Starts the Depot process with a given name to represent the resource.