View Source Ravix.Connection (ravix v0.0.3)

Service to manage the connection with a RavenDB database

Link to this section Summary

Functions

Returns a specification to start this module under a supervisor.

Fetches the connection state for the specified Ravix.Document.Store

Callback implementation for GenServer.init/1.

Receives the reference of a RavenDB store and a initial store state and starts a connection, the connection is registered in the :connections register under the naming StoreModule.Connection

Triggers a topology update for the specified Ravix.Document.Store, this operation is asynchronous and will be done on background

Link to this section Functions

Returns a specification to start this module under a supervisor.

See Supervisor.

@spec fetch_state(atom()) ::
  {:error, :connection_not_found} | {:ok, Ravix.Connection.State.t()}

Fetches the connection state for the specified Ravix.Document.Store

Returns:

- `{:ok, Ravix.Connection.State}` if the connection exists
- `{:error, :connection_not_found` if the connection does not exists

Callback implementation for GenServer.init/1.

Link to this function

start_link(store, conn_state)

View Source
@spec start_link(atom(), Ravix.Connection.State.t()) ::
  :ignore | {:error, any()} | {:ok, pid()}

Receives the reference of a RavenDB store and a initial store state and starts a connection, the connection is registered in the :connections register under the naming StoreModule.Connection

Returns: {:ok, pid} if the connecion is started {:error, cause} if the connection start failed

@spec update_topology(atom()) :: :ok

Triggers a topology update for the specified Ravix.Document.Store, this operation is asynchronous and will be done on background

Returns :ok